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

Method add_neighbor

graphs/prim.py:38–40  ·  view source on GitHub ↗

Add a pointer to a vertex at neighbor's list.

(self, vertex)

Source from the content-addressed store, hash-verified

36 return self.id
37
38 def add_neighbor(self, vertex):
39 """Add a pointer to a vertex at neighbor's list."""
40 self.neighbors.append(vertex)
41
42 def add_edge(self, vertex, weight):
43 """Destination vertex and weight."""

Callers 1

connectFunction · 0.80

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected