ott.geometry.graph.Graph.from_graph#
- classmethod Graph.from_graph(G, t=0.001, directed=False, normalize=False, **kwargs)[source]#
Construct
Graphfrom an adjacency matrix.- Parameters:
G (
Array) – Adjacency matrix.t (
Optional[float]) – Constant used when approximating the geodesic exponential kernel. If None, use \(\frac{1}{|E|} \sum_{(u, v) \in E} weight(u, v)\) [Crane et al., 2013]. In this case, thegraphmust be specified and the edge weights are all assumed to be positive.directed (
bool) – Whether thegraphis directed. If not, it will be made undirected as \(G + G^T\). This parameter is ignored when directly passing the Laplacian, which is assumed to be symmetric.normalize (
bool) – Whether to normalize the Laplacian as \(L^{sym} = \left(D^+\right)^{\frac{1}{2}} L \left(D^+\right)^{\frac{1}{2}}\), where \(L\) is the non-normalized Laplacian and \(D\) is the degree matrix.
- Return type:
- Returns:
The graph geometry.