Road and Rail Networks
Computer Chips
Supply Chains
Friendships
Neural Connections
The Internet
Graph: Consists of points called vertices connected by edges.
Representation: G = (V, E) where V = set of vertices, E = set of edges.
Ordered pair: (u, v) directs from vertex u to v.
Unordered pair: {u, v}.
Loop: Edge connecting a vertex to itself (e.g., {u, u}).
Multiple Edges: Two or more edges connecting the same pair of vertices.
Consists of distinct vertices and no multiple edges or loops.
Representation: G(V, E).
Example: V = {u, v, w}, E = {{u, v}, {v, w}, {u, w}}.
Can have multiple edges and loops between the same vertices.
Example: Graph with edges joining B and C multiple times.
G(V, E) where edges are ordered pairs.
Adjacent Vertices: If {u, v} is an edge.
Degree of Vertex (deg(v)): Number of edges connected to vertex v.
Isolated: deg(v) = 0
Pendant: deg(v) = 1
In-Degree: Number of edges leading to vertex.
Out-Degree: Number of edges leading from vertex.
2e = sum of degrees of all vertices.
Undirected graphs have an even number of odd degree vertices.
An Eulerian path uses each edge exactly once.
An Eulerian cycle uses each edge exactly once and returns to starting vertex.
A Hamiltonian path visits each vertex exactly once.
A Hamiltonian cycle is a cycle visiting each vertex exactly once.
Can be drawn without overlapping edges.
Example: VLSI design, circuit design.
Incidence Matrix: Useful for edges over vertices.
Adjacency Matrix/List: Useful for vertices over edges.
Edge List: Each element represents an edge connecting nodes.
Starts from a node and explores as far as possible along each branch.
Implemented using a stack structure.
Visits all immediate neighbors before moving to the next level.
Implemented using a queue structure.