|
1 | 1 | from _typeshed import Incomplete |
| 2 | +from collections.abc import Callable, Mapping |
| 3 | +from typing import Generic |
2 | 4 |
|
3 | 5 | from networkx.classes.graph import Graph, _Node |
4 | 6 | from networkx.utils.backends import _dispatchable |
5 | 7 |
|
6 | 8 | __all__ = ["treewidth_min_degree", "treewidth_min_fill_in"] |
7 | 9 |
|
8 | 10 | @_dispatchable |
9 | | -def treewidth_min_degree(G: Graph[_Node]): ... |
| 11 | +def treewidth_min_degree(G: Graph[_Node]) -> tuple[int, Graph[frozenset[_Node]]]: ... |
10 | 12 | @_dispatchable |
11 | | -def treewidth_min_fill_in(G: Graph[_Node]): ... |
| 13 | +def treewidth_min_fill_in(G: Graph[_Node]) -> tuple[int, Graph[frozenset[_Node]]]: ... |
12 | 14 |
|
13 | | -class MinDegreeHeuristic: |
| 15 | +class MinDegreeHeuristic(Generic[_Node]): |
14 | 16 | count: Incomplete |
15 | 17 |
|
16 | | - def __init__(self, graph) -> None: ... |
17 | | - def best_node(self, graph): ... |
| 18 | + def __init__(self, graph: Graph[_Node]) -> None: ... |
| 19 | + def best_node(self, graph: Mapping[_Node, set[_Node]]) -> _Node | None: ... |
18 | 20 |
|
19 | | -def min_fill_in_heuristic(graph_dict) -> Incomplete | None: ... |
| 21 | +def min_fill_in_heuristic(graph_dict: Mapping[_Node, set[_Node]]) -> _Node | None: ... |
20 | 22 | @_dispatchable |
21 | | -def treewidth_decomp(G: Graph[_Node], heuristic=...) -> tuple[int, Graph[_Node]]: ... |
| 23 | +def treewidth_decomp( |
| 24 | + G: Graph[_Node], heuristic: Callable[[dict[_Node, set[_Node]]], _Node | None] = ... |
| 25 | +) -> tuple[int, Graph[frozenset[_Node]]]: ... |
0 commit comments