Professional Documents
Culture Documents
Graphs
Graph:- A graph consists of a nonempty set of points or vertices, and a set of edges that link together the
vertices. A simple real world example of a graph would be your house and the corner store. Where the house
and the store are the vertices and the road between them is the edge connecting the two vertices.
Simple Graph
Directed Graph:- A directed graph is one in which the direction of any given edge is defined.
Or A graph with directed edges = directed graph (digraph)
Directed edges = arcs
Directed Graph
Undirected Graph:- An undirected graph is one in which the direction of any given edge is not defined.
Conversely, in an undirected graph you can move in both directions between vertices. Or a graph with
undirected edges is called undirected graph.
Undirected graph
Mixed Graph:- A graph is one in which contains both directed and undirected edges.
Mixed Graph
Null Graph: - A null graph is one that contains only isolated vertices (example no edges).
Null Graph
Connected graph:- All vertices are directly or indirectly connected with each other (otherwise we have a
graph, consisting of at least two sub graphs).
Connected Graph
Complete graph:- Each vertex is directly connected with every other vertex. Or a simple graph in which
every pair of vertices is adjacent.
Complete Graph
Hamiltonian cycle:- Cycle in graph such that all vertices of the graph are vertices of the cycle
Hamiltonian graph Hamiltonian Cycle
Paths
Path:- Is a sequence of adjoining edges (open walk), where no edge and no vertex is repeated
Or a path through a graph is a traversal of consecutive vertices along a sequence of edges. The vertex at the
end of one edge in the sequence must also be the vertex at the beginning of the next edge in the sequence
The vertices that begin and end the path are termed the initial vertex and terminal vertex.
Path length:- The length of the path is the number of edges that are traversed along the path. the length of
the path in above example is 5.
cycle:- is a path in which the initial vertex of the path is also the terminal vertex of the path.
Walks
walk :- is an alternating sequence of vertices and edges, beginning and ending with a vertex, where each
vertex is incident to both the edge that precedes it and the edge that follows it in the sequence, and where the
vertices that precede and follow an edge are the end vertices of that edge.
Open Walk:- A walk is open if its first and last vertices are different.
Note:- A path referred to what is now usually known as an open walk.
Closed Walk:- A walk is closed if its first and last vertices are the same, and open if they are different.
Note:- A cycle traditionally referred to any closed walk.
Walk Length:- The length l of a walk is the number of edges that it uses. For an open walk, l = n–1, where n
is the number of vertices visited (a vertex is counted each time it is visited). For a closed walk, l = n (the
start/end vertex is listed twice, but is not counted twice). In the example graph, (1, 2, 5, 1, 2, 3) is an open
walk with length 5, and (4, 5, 2, 1, 5, 4) is a closed walk of length 5.
Minimum spanning tree:- is a spanning tree, but has weights or lengths associated with the edges, and the
total weight of the tree (the sum of the weights of its edges) is at a minimum.
Weighted Graph Minimum Spanning Tree
Rooted tree:- Directed tree with a distinguished vertex, called the root, from which a directed path to every
other vertex exists
Depth:- of a rooted tree = max length of a path to the end node
Rooted Tree