|
| 1 | +from typing import Literal |
| 2 | + |
| 3 | +import numpy as np |
| 4 | +from networkx._typing import Array1D, Seed |
| 5 | +from networkx.classes.graph import Graph, _Node |
1 | 6 | from networkx.utils.backends import _dispatchable |
2 | 7 |
|
3 | 8 | __all__ = ["algebraic_connectivity", "fiedler_vector", "spectral_ordering", "spectral_bisection"] |
4 | 9 |
|
5 | | -class _PCGSolver: |
6 | | - def __init__(self, A, M) -> None: ... |
7 | | - def solve(self, B, tol): ... |
8 | | - |
9 | | -class _LUSolver: |
10 | | - def __init__(self, A) -> None: ... |
11 | | - def solve(self, B, tol=None): ... |
12 | | - |
13 | 10 | @_dispatchable |
14 | 11 | def algebraic_connectivity( |
15 | | - G, weight: str = "weight", normalized: bool = False, tol: float = 1e-08, method: str = "tracemin_pcg", seed=None |
16 | | -): ... |
| 12 | + G: Graph[_Node], |
| 13 | + weight: str | None = "weight", |
| 14 | + normalized: bool = False, |
| 15 | + tol: float = 1e-08, |
| 16 | + method: Literal["tracemin_pcg", "tracemin_lu", "lanczos", "lobpcg"] = "tracemin_pcg", |
| 17 | + seed: Seed | None = None, |
| 18 | +) -> float: ... |
17 | 19 | @_dispatchable |
18 | 20 | def fiedler_vector( |
19 | | - G, weight: str = "weight", normalized: bool = False, tol: float = 1e-08, method: str = "tracemin_pcg", seed=None |
20 | | -): ... |
| 21 | + G: Graph[_Node], |
| 22 | + weight: str | None = "weight", |
| 23 | + normalized: bool = False, |
| 24 | + tol: float = 1e-08, |
| 25 | + method: Literal["tracemin_pcg", "tracemin_lu", "lanczos", "lobpcg"] = "tracemin_pcg", |
| 26 | + seed: Seed | None = None, |
| 27 | +) -> Array1D[np.float64]: ... |
21 | 28 | @_dispatchable |
22 | 29 | def spectral_ordering( |
23 | | - G, weight: str = "weight", normalized: bool = False, tol: float = 1e-08, method: str = "tracemin_pcg", seed=None |
24 | | -): ... |
| 30 | + G: Graph[_Node], |
| 31 | + weight: str | None = "weight", |
| 32 | + normalized: bool = False, |
| 33 | + tol: float = 1e-08, |
| 34 | + method: Literal["tracemin_pcg", "tracemin_lu", "lanczos", "lobpcg"] = "tracemin_pcg", |
| 35 | + seed: Seed | None = None, |
| 36 | +) -> list[_Node]: ... |
25 | 37 | @_dispatchable |
26 | 38 | def spectral_bisection( |
27 | | - G, weight: str = "weight", normalized: bool = False, tol: float = 1e-08, method: str = "tracemin_pcg", seed=None |
28 | | -): ... |
| 39 | + G: Graph[_Node], |
| 40 | + weight: str | None = "weight", |
| 41 | + normalized: bool = False, |
| 42 | + tol: float = 1e-08, |
| 43 | + method: Literal["tracemin_pcg", "tracemin_lu", "lanczos", "lobpcg"] = "tracemin_pcg", |
| 44 | + seed: Seed | None = None, |
| 45 | +) -> tuple[set[_Node], set[_Node]]: ... |
0 commit comments