MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / __get_demo_graph

Function __get_demo_graph

graphs/finding_bridges.py:13–57  ·  view source on GitHub ↗
(index)

Source from the content-addressed store, hash-verified

11
12
13def __get_demo_graph(index):
14 return [
15 {
16 0: [1, 2],
17 1: [0, 2],
18 2: [0, 1, 3, 5],
19 3: [2, 4],
20 4: [3],
21 5: [2, 6, 8],
22 6: [5, 7],
23 7: [6, 8],
24 8: [5, 7],
25 },
26 {
27 0: [6],
28 1: [9],
29 2: [4, 5],
30 3: [4],
31 4: [2, 3],
32 5: [2],
33 6: [0, 7],
34 7: [6],
35 8: [],
36 9: [1],
37 },
38 {
39 0: [4],
40 1: [6],
41 2: [],
42 3: [5, 6, 7],
43 4: [0, 6],
44 5: [3, 8, 9],
45 6: [1, 3, 4, 7],
46 7: [3, 6, 8, 9],
47 8: [5, 7],
48 9: [5, 7],
49 },
50 {
51 0: [1, 3],
52 1: [0, 2, 4],
53 2: [1, 3, 4],
54 3: [0, 2, 4],
55 4: [1, 2, 3],
56 },
57 ][index]
58
59
60def compute_bridges(graph: dict[int, list[int]]) -> list[tuple[int, int]]:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected