Graphs are a structure consisting of a set of objects called nodes, which are connected using a binary relation known as their edges. They are used extensively in modelling network-based problems, especially in computer science and electrical engineering
Definition
A graph is a set, consisting of two smaller subsets for nodes and edges. It is notated as . is a set of vertices, and is a binary relation on .
Note that not all nodes need to be connected.
Terms
Node
- Two nodes are said to be adjacent if an edge exists between them.**
Graph
- Order: Number of vertices or nodes, i.e. the cardinality of =
- Size: Number of edges of a graph, i.e. the cardinality of =
- Degree : The number of edges connected to a given node is it’s degree. Depending if the graph is directed, the degree may be separated into:
- In-degree: Number of edges pointing at the node,
- Out-degree: Number of edges exiting the node
- Diameter: The number of edges in the longest, shortest path between any pair of nodes. The diameter of a disconnected graph is always infinity.
- Graph Density: Define as the ratio of the size of the graph to the maximum possible size of a graph =
Graph Types
Graph Traversal