MCPcopy Index your code
hub / github.com/TheAlgorithms/Python / contains_vertex

Method contains_vertex

graphs/graph_adjacency_matrix.py:165–169  ·  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

163 )
164
165 def contains_vertex(self, vertex: T) -> bool:
166 """
167 Returns True if the graph contains the vertex, False otherwise.
168 """
169 return vertex in self.vertex_to_index
170
171 def contains_edge(self, source_vertex: T, destination_vertex: T) -> bool:
172 """

Callers 8

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

Calls

no outgoing calls

Tested by 1

test_contains_vertexMethod · 0.76