Skip to main content

Graph.list_vertices

List the vertices in the graph

Usage

list_vertices()

Returns:
      list
            A list containing the unique identifiers of the vertices

Example

from jellybeans.structures import Graphg = Graph()print(g.list_vertices()) # []g.add_vertex(1)g.add_vertex(5)g.add_vertex(11)print(g.list_vertices()) # [1, 5, 11]g.delete_vertex(5)print(g.list_vertices()) # [1, 11]