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:
t (
Optional[float]) – 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)\) [Crane et al., 2013]. In this case, thegraphmust be specified and the edge weights are assumed to be positive.eigval (
Optional[Array]) – Largest eigenvalue of the Laplacian. IfNone, it’s computed usingjax.experimental.sparse.linalg.lobpcg_standard().order (
int) – Max order of Chebyshev polynomials.directed (
bool) – Whether thegraphis directed. IfTrue, 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 (
Optional[Array]) – Random key used when computing the largest eigenvalue.
- Return type:
- Returns:
The Geodesic geometry.