pytspl.simplicial_complex.scbuilder
SC builder module to build simplicial complex networks using 0-simplices (nodes), 1-simplices (edges) and 2-simplices (triangles).
- The 2-simplices can be added in three ways:
Triangles passed as an argument.
All triangles in the simplicial complex.
Triangles based on a condition e.g. distance.
Classes
SCBuilder is used to build a simplicial complex by defining the |
Module Contents
- class pytspl.simplicial_complex.scbuilder.SCBuilder(nodes: list, edges: list, node_features: dict = {}, edge_features: dict = {})[source]
SCBuilder is used to build a simplicial complex by defining the 2-simplices using different ways.
- nodes
- edges
- node_features
- edge_features
- triangles_dist_based(dist_col_name: str, epsilon: float) list[source]
- Get a list of triangles in the graph that satisfy the condition:
d(a, b) < epsilon, d(a, c) < epsilon, d(b, c) < epsilon
- Args:
dist_col_name (str): Name of the column that contains the distance. epsilon (float, optional): Distance threshold to consider for triangles.
- Returns:
list: List of triangles that satisfy the condition.
- to_simplicial_complex(condition: str = 'all', dist_col_name: str = 'distance', dist_threshold: float = 1.5, triangles=None) pytspl.simplicial_complex.SimplicialComplex[source]
Convert the graph to a simplicial complex using the given condition of simplices. The simplicial complex will also have node and edge features.
- Args:
condition (str, optional): Condition to build the 2-simplices (triangles). Defaults to “all”. Options: - “all”: All simplices. - “distance”: Based on distance.
dist_col_name (str, optional): Name of the column that contains the distance. dist_threshold (float, optional): Distance threshold to consider for simplices. Defaults to 1.5.
- Returns:
SimplicialComplex: Simplicial complex network.