MCPcopy Create free account
hub / github.com/jwasham/practice-python / add_edge

Method add_edge

graphs/undirected_graph_matrix.py:14–23  ·  view source on GitHub ↗

Adds an edge defined by vertices from source to destination then destination to source in matrix :param source: :param destination: :return:

(self, source, destination)

Source from the content-addressed store, hash-verified

12 self.adjacency_matrix.append([0] * vertices)
13
14 def add_edge(self, source, destination):
15 """
16 Adds an edge defined by vertices from source to destination
17 then destination to source in matrix
18 :param source:
19 :param destination:
20 :return:
21 """
22 self.adjacency_matrix[source][destination] = 1
23 self.adjacency_matrix[destination][source] = 1
24
25 def get_vertex(self):
26 """

Callers 2

get_test_graph_1Function · 0.95
get_test_graph_2Function · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected