MCPcopy
hub / github.com/jwasham/practice-python / add_edge

Method add_edge

graphs/directed_graph_list.py:13–22  ·  view source on GitHub ↗

Adds an edge defined by vertices source and destination :param source: :param destination: :return:

(self, source, destination)

Source from the content-addressed store, hash-verified

11 self.adjacency_list = {}
12
13 def add_edge(self, source, destination):
14 """
15 Adds an edge defined by vertices source and destination
16 :param source:
17 :param destination:
18 :return:
19 """
20 if source not in self.adjacency_list:
21 self.adjacency_list[source] = set()
22 self.adjacency_list[source].add(destination)
23
24 def get_vertex(self):
25 """

Callers 5

get_test_graph_1Function · 0.95
get_test_graph_2Function · 0.95
get_test_graph_3Function · 0.95
get_test_graph_5Function · 0.95
get_test_graph_4Function · 0.45

Calls 1

addMethod · 0.45

Tested by

no test coverage detected