An ADT which represents information through nodes and edges.
Notation
Properties
Representations
- Adjacency matrix
- Adjacency list
- Incidence matrix
- A diagram with nodes interconnected using edges.
Signature
name: Graph
import: node, edge, list, bool
operators:
newGraph: -> Graph;
nodes: Graph -> list;
edges: Graph -> list;
addNode: Graph × node -> Graph;
deleteNode: Graph × node -> Graph;
addEdge: Graph × edge -> Graph;
deleteEdge: Graph × edge -> Graph;
isAdjacent: Graph × node × node -> boolean;
neighbours: Graph × node -> list;