ott.geometry.geodesic.Geodesic.from_graph#

classmethod Geodesic.from_graph(G, t=0.001, eigval=None, order=100, directed=False, normalize=False, rng=None, **kwargs)[source]#

Construct a Geodesic geometry from an adjacency matrix.

Parameters:
• G () – Adjacency matrix.

• t () – Time parameter for approximating the geodesic exponential kernel. If None, it defaults to $$\frac{1}{|E|} \sum_{(u, v) \in E} \text{weight}(u, v)$$ . In this case, the graph must be specified and the edge weights are assumed to be positive.

• eigval () – Largest eigenvalue of the Laplacian. If None, it’s computed using jax.experimental.sparse.linalg.lobpcg_standard().

• order (int) – Max order of Chebyshev polynomials.

• directed (bool) – Whether the graph is directed. If True, it’s made undirected as $$G + G^T$$. This parameter is ignored when passing the Laplacian directly, 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.

• rng () – Random key used when computing the largest eigenvalue.

• kwargs (Any) – Keyword arguments for Geodesic.

Return type:

Geodesic

Returns:

The Geodesic geometry.