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

Method contains_vertex

graphs/graph_adjacency_list.py:159–163  ·  view source on GitHub ↗

Returns True if the graph contains the vertex, False otherwise.

(self, vertex: T)

Source from the content-addressed store, hash-verified

157 self.adj_list[destination_vertex].remove(source_vertex)
158
159 def contains_vertex(self, vertex: T) -> bool:
160 """
161 Returns True if the graph contains the vertex, False otherwise.
162 """
163 return vertex in self.adj_list
164
165 def contains_edge(self, source_vertex: T, destination_vertex: T) -> bool:
166 """

Callers 8

add_vertexMethod · 0.95
add_edgeMethod · 0.95
remove_vertexMethod · 0.95
remove_edgeMethod · 0.95
contains_edgeMethod · 0.95
test_contains_vertexMethod · 0.95

Calls

no outgoing calls

Tested by 1

test_contains_vertexMethod · 0.76