Skip to main content

Graph.delete_edge

Remove a directed edge from the graph

Usage

delete_edge(edge:list)

Parameters:
      edge : list
            A list in the form of: [source vertice, destination vertice]

Example

from jellybeans.structures import Graphg = Graph()g.add_vertex(1)g.add_vertex(5)g.add_bidirected_edge(1, 5, (20, 30))g.delete_edge([1, 5])print(g.to_adj_list()) # {1: [], 5: [(1, 30)]}