1
- from _typeshed import Incomplete
2
1
from collections .abc import Generator
2
+ from typing import Literal
3
3
4
4
from networkx .classes .digraph import DiGraph
5
- from networkx .classes .graph import Graph , _Node
5
+ from networkx .classes .graph import Graph , _NBunch , _Node
6
6
from networkx .utils .backends import _dispatchable
7
7
8
8
__all__ = [
@@ -16,23 +16,18 @@ __all__ = [
16
16
]
17
17
18
18
@_dispatchable
19
- def cycle_basis (G : Graph [_Node ], root : _Node | None = None ): ...
19
+ def cycle_basis (G : Graph [_Node ], root : _Node | None = None ) -> list [ list [ _Node ]] : ...
20
20
@_dispatchable
21
- def simple_cycles (G : Graph [_Node ], length_bound : int | None = None ) -> Generator [Incomplete , Incomplete , None ]: ...
22
-
23
- class _NeighborhoodCache (dict [Incomplete , Incomplete ]):
24
- G : Incomplete
25
-
26
- def __init__ (self , G ) -> None : ...
27
- def __missing__ (self , v ): ...
28
-
21
+ def simple_cycles (G : Graph [_Node ], length_bound : int | None = None ) -> Generator [list [_Node ]]: ...
29
22
@_dispatchable
30
- def chordless_cycles (G : DiGraph [_Node ], length_bound : int | None = None ) -> Generator [Incomplete , Incomplete , None ]: ...
23
+ def chordless_cycles (G : DiGraph [_Node ], length_bound : int | None = None ) -> Generator [list [ _Node ] ]: ...
31
24
@_dispatchable
32
- def recursive_simple_cycles (G : DiGraph [_Node ]): ...
25
+ def recursive_simple_cycles (G : DiGraph [_Node ]) -> list [ list [ _Node ]] : ...
33
26
@_dispatchable
34
- def find_cycle (G : Graph [_Node ], source = None , orientation = None ): ...
27
+ def find_cycle (
28
+ G : Graph [_Node ], source : _NBunch [_Node ] = None , orientation : Literal ["original" , "reverse" , "ignore" ] | None = None
29
+ ): ...
35
30
@_dispatchable
36
- def minimum_cycle_basis (G : Graph [_Node ], weight : str | None = None ): ...
31
+ def minimum_cycle_basis (G : Graph [_Node ], weight : str | None = None ) -> list [ list [ _Node ]] : ...
37
32
@_dispatchable
38
- def girth (G ) -> float | int : ...
33
+ def girth (G : Graph [ _Node ] ) -> float | int : ... # accepts any graph type
0 commit comments