|
12 | 12 | # - A collection of edges E, represented as ordered pairs of vertices (u,v)
|
13 | 13 | #
|
14 | 14 | # Graph Terminology
|
15 | | -# Adjacency: A vertex is said to be adjacent to another vertex if there is an edge connecting them. Vertices 2 and 3 are not adjacent because there is |
16 | | -# no edge between them. |
17 | | -# Path: A sequence of edges that allows you to go from vertex A to vertex B is called a path. 0-1, 1-2 and 0-2 are paths from vertex 0 to vertex 2. |
18 | | -# Directed Graph: A graph in which an edge (u,v) doesn't necessarily mean that there is an edge (v, u) as well. The edges in such a graph are represented |
19 | | -# by arrows to show the direction of the edge. |
| 15 | +# Adjacency: A vertex is said to be adjacent to another vertex if there is an edge connecting them. |
| 16 | +# Path: A sequence of edges that allows you to go from vertex A to vertex B is called a path. |
| 17 | +# Directed Graph: A graph in which an edge (u,v) doesn't necessarily mean that there is an edge (v, u) as well. |
| 18 | +# The edges in such a graph are represented by arrows to show the direction of the edge. |
20 | 19 | #
|
21 | 20 | # Operations
|
22 | 21 | #
|
|
44 | 43 | # Text Source: Graph (abstract data type)
|
45 | 44 | # URL: https://en.wikipedia.org/wiki/Graph_(abstract_data_type)
|
46 | 45 |
|
| 46 | +from queuelinkedlist import LinkedListQueue |
47 | 47 | import numpy as np
|
48 | 48 |
|
49 | 49 | class Graph:
|
|
0 commit comments