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

Function main

graphs/eulerian_path_and_circuit_for_undirected_graph.py:52–67  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

50
51
52def main():
53 g1 = {1: [2, 3, 4], 2: [1, 3], 3: [1, 2], 4: [1, 5], 5: [4]}
54 g2 = {1: [2, 3, 4, 5], 2: [1, 3], 3: [1, 2], 4: [1, 5], 5: [1, 4]}
55 g3 = {1: [2, 3, 4], 2: [1, 3, 4], 3: [1, 2], 4: [1, 2, 5], 5: [4]}
56 g4 = {1: [2, 3], 2: [1, 3], 3: [1, 2]}
57 g5 = {
58 1: [],
59 2: [],
60 # all degree is zero
61 }
62 max_node = 10
63 check_euler(g1, max_node)
64 check_euler(g2, max_node)
65 check_euler(g3, max_node)
66 check_euler(g4, max_node)
67 check_euler(g5, max_node)
68
69
70if __name__ == "__main__":

Calls 1

check_eulerFunction · 0.85

Tested by

no test coverage detected