Skip to content

DiGraph

AmitSheer edited this page Jan 8, 2021 · 2 revisions

This class is a representation of a Directed-Weighted Graph. It holds the edges and nodes in a Dictionary for easy and fast access of the values held within.

Feilds

all inner fields are protected

Methods

  1. e_size(self) -> int
  2. get_all_v(self) -> dict
  3. all_in_edges_of_node(self, id1: int) -> dict
  4. all_out_edges_of_node(self, id1: int) -> dict
  5. get_mc(self) -> int
  6. add_edge(self, id1: int, id2: int, weight: float) -> bool
  7. add_node(self, node_id: int, pos: tuple = None) -> bool
  8. remove_node(self, node_id: int) -> bool
  9. remove_edge(self, node_id1: int, node_id2: int) -> bool

Clone this wiki locally