23-12-2020 Lecture Notes - 11
23-12-2020 Lecture Notes - 11
Lecture#10
Graph Introduction,
BFT, DFT,
MST,
Shortest Path
Lecture Contents
Graph
Graph Terminologies
Graph Representations (Adjacency Matrix, Adjacency Link List)
Graph Traversals (Depth First, Breadth First)
Spanning Tree
Minimum Spanning Tree
Kruskalls’ Algorithm
Prim’s Algorithm
Shortest Path
Dijkstra’s Algorithm
Bellman Ford Algorithm
A* Algorithm
Graph
A graph G (V, X) consists of two sets V & X. V is a set of
vertices & X is a set of Edges
Every edge e ϵ X joins two vertices in V
Graph G = (V, X)
where V = Set of vertices
AND X = set of edges
AND X V x V
Example:
G = (V, X)
V = {A, B, C, D, E, F}
X = {(A,B), (A,C), (B,D), (D,E), (D,F), (C,E), (C, F), (E,F)}
Directed Graph (Digraph)
A directed graph is a graph in which all edges are directed.
Directed graph is also called a digraph.
G = (V, E)
V = {A, B, C, D, F, G}
E = {(A,B), (A,C), (B,D), (D,E), (D,F), (C,E), (E,F), (F,C)}
Undirected Graph
A undirected graph is a graph in which all edges are bidirectional.
In an undirected graph G(V,E),
∀e ϵ E
e1 (u, v) = e2 (u, v)
Connected Graph
A graph is connected if there is path between every two nodes of
that graph.
Complete Graph
•A graph is complete if there is edge between every two nodes of
that graph.
Total number of edges in complete graph are given as:
Degree, In Degree, Out Degree
Degree:
Number of edges connecting a vertex is called the
degree of node.
Degree of vertex A is 6
In Degree:
Number of edges pointing into a vertex is called its in
degree
In Degree of vertex A is 2
Out Degree:
Number of edges going out of a vertex is called its out
degree
Out Degree of vertex A is 4
Adjacency
Two nodes are said to be adjacent if they are connected through an edge.
In the example below nodes B&C, C&D, D&E are adjacent to each other.
Adjacent Nodes
Weighted Graph
A graph in which every edge has some weight
(numeric value) associated with it.
It refers to the effort while going from one vertex to
other using this edge
Weighted Graph
Unweighted Graph
A graph having no weight value associated with
any of its edge is called an unweighted graph
Unweighted Graph
Reachable Node
A node is reachable from another node if there exists a path
between them.
Multigraph
A graph is said to be multigraph if it allows more
than one paths between two nodes
Pseudo Graph
A graph is pseudo graph if it allows if it allows self
loops
Pseudo Graph
Reachable Node
A node is reachable from another node if
there exists a path between them.
1. ABCD is a path
2. ABD is not a path
Cycle
A cycle is a path starting and ending at same vertex
Hamiltonian Cycle:
A, B, C, D, E, F, G, H, A
Eulerian Cycle
An Eulerian Cycle of a connected directed / undirected graph is a cycle
that traverses each edge of a graph exactly once. There may be one
vertex that is visited more than once.
Eulerian Cycle:
A, B, C, D, E, F, C, G back to A
Subgraph
A subgraph H of graph G is a graph that has its vertices and edges
as subsets of vertices and edges of G respectively.
Graph G
V = {A, B, C, D, E, F, G}
Subgraph H Edges={(A,B), (A,G), (B,C), (B, G), (C,D), (C,F), (C,G),
V = {A, B, C, G} (D,E), (D,F), (E,F)}
Edges={(A,B), (A,G), (B,C), (B, G), (C,G)}
Tree
A connected graph without any cycles is call a tree graph or simply a tree.
For a tree graph, there is a unique path between every two nodes of the
graph
Tree
Graph Representation
Graphs are represented through two different ways:
1. Adjacency Matrix
2. Adjacency List
Graph Adjacency Matrix Representation
Say a graph has V={1,2,3,…,n} vertices then graph is represented by
a NXN matrix A such that:
A[i, j] = 1 if there is edge between nodes i & j
= 0 otherwise
Graph G
Graph G 1 2 3 4
1 0 0 1 0
2 0 0 1 1
3 1 1 0 1
4 0 1 1 0
1. Node E is visited
2. Processing of E neighbors continues Neighbors list of E: {C, D, F}
3. Since C is not already visited, dfs(G, C) is called Visited Nodes = {A, B, D, E}
suspending function dfs(G, E)
Depth First Graph Traversal (Recursive) … Demo
Graph = G
proc dfs(G, v) // G is graph, v is a vertex G = (V, X)
V = {A, B, C, D, E, F}
v.visited = true X = {(A,B), (A, C), (B, D), (C, E),(D, E), (D, F), (E, G)}
list G.getAdjacencyList(v)
foreach node in list do
Active function call: dfs(G, C)
if node.visited != true then
dfs(G, node)
endif
next
end proc
1. Node C is visited
2. Processing of C neighbors continues Neighbors list of C: {A, E}
3. Since A is already visited, dfs(G, C) is not called. Visited Nodes = {A, B, D, E, C}
Processing of neighbors continues
Depth First Graph Traversal (Recursive) … Demo
Graph = G
proc dfs(G, v) // G is graph, v is a vertex G = (V, X)
V = {A, B, C, D, E, F}
v.visited = true X = {(A,B), (A, C), (B, D), (C, E),(D, E), (D, F), (E, G)}
list G.getAdjacencyList(v)
foreach node in list do
Active function call: dfs(G, C)
if node.visited != true then
dfs(G, node)
endif
next
end proc
1. dfs(G, E) resumes
2. Since F is not already visited, dfs(G, F) is called Neighbors list of E: {C, D, F}
suspending the execution of dfs(G, E) Visited Nodes = {A, B, D, E, C}
Depth First Graph Traversal (Recursive) … Demo
Graph = G
proc dfs(G, v) // G is graph, v is a vertex G = (V, X)
V = {A, B, C, D, E, F}
v.visited = true X = {(A,B), (A, C), (B, D), (C, E),(D, E), (D, F), (E, G)}
list G.getAdjacencyList(v)
foreach node in list do
Active function call: dfs(G, F)
if node.visited != true then
dfs(G, node)
endif
next
end proc
1. Node F is visited
2. One can observe that all nodes of G are visited now
3. Since all neighbors of F are already visited, no call to Neighbors list of F: {D, E}
dfs() Visited Nodes = {A, B, D, E, C, F}
4. dfs(G, F) exits giving control back to dfs(G, E)
Depth First Graph Traversal (Recursive) … Demo
proc dfs(G, v) // G is graph, v is a vertex
v.visited = true
list G.getAdjacencyList(v)
foreach node in list do
if node.visited != true then Visited Nodes = {A, B, D, E, C, F}
dfs(G, node)
endif
next
end proc
1. All the calls to dfs() exit now one by one since
all the nodes in graph are already visited
2. Depth first traversal ends
Depth First Graph Traversal (Iterative)… Demo
proc dfs(G, v) // G is graph, v is a vertex
stack.push(v)
while !stack.empty() do dfs() was initially called as:
v stack.pop() dfs(G, A)
v.visited true
A node is pushed to stack
list G.getAdjacencyList(v)
foreach node in list do
if node.visited != true then
stack.push(node)
endif
next
next
end proc
While-loop executes
v=A
v is visited
list = {B, C}
Depth First Graph Traversal (Iterative)… Demo
While-loop executes
While-loop executes
While-loop executes
Spanning tree T1
Spanning tree T2
Spanning Tree (ST)
“A spanning tree is a subset of Graph G, which has all the
vertices covered with minimum possible number of edges”
Number of vertices for all spanning trees of a graph are Graph G
same
Number of edges for all spanning trees of a graph are same
All spanning trees form a minimally connected graph i.e.
one takes away one edge from ST and it is no more a
spanning tree
Adding one edge to ST will introduce a cycle i.e. ST is
maximally acyclic Spanning tree T1
Spanning Tree (ST) … Applications
Network Planning & Design
Network Routing Protocols
Cluster Analysis
Approximation Algorithms for NP-hard Problems
Image Registration & Segmentation Algorithms
Minimax Process Control
etc
Minimum Spanning Tree (MST)
“Minimum spanning tree is subset of edges of a
connected, weighted undirected graph that connects all
vertices together and bears the minimum possible total Spanning Tree T1
edge weight”
Minimum Spanning Tree is also called Minimum
Weight Spanning Tree
MST is a tree so it does not contain any cycle
resultSet={}
Vertices = {A, B, C, D, E, F}
{A}, {B}, {C}, {D}, {E}, {F}
Graph G
Kruskal’s Algorithm for MST … Demonstration
resultSet={}
Vertices = {A, B, C, D, E, F}
{A}, {B}, {C}, {D}, {E}, {F}
Edges = {(D,F), (A,D), (C,F), (A,B), (C,D),
(B,C), (D,E), (E,F), (B,D)}
Graph G
Kruskal’s Algorithm for MST … Demonstration
Edges = {(D,F), (A,D), (C,F), (A,B),
(C,D), (B,C), (D,E), (E,F), (B,D)}
(u,v) = (D, F)
If condition = TRUE
{A}, {B}, {C}, {D(rank=1), F(rank=0)},
{E}
resultSet={(D,F)}
Graph G
Kruskal’s Algorithm for MST … Demonstration
Edges = {(D,F), (A,D), (C,F), (A,B), (C,D),
(B,C), (D,E), (E,F), (B,D)}
(u,v) = (A, D)
If condition = TRUE
resultSet={(D, F), (A,D)}
{B}, {C}, {D, A, F}, {E}
Graph G
Kruskal’s Algorithm for MST … Demonstration
Edges = {(D,F), (A,D), (C,F), (A,B), (C,D),
(B,C), (D,E), (E,F), (B,D)}
(u,v) = (C,F)
If condition = TRUE
resultSet={(D,F), (A,D), (C,F)}
{B}, {D, A, F, C}, {E}
Graph G
Kruskal’s Algorithm for MST … Demonstration
Edges = {(D,F), (A,D), (C,F), (A,B),
(C,D), (B,C), (D,E), (E,F), (B,D)}
(u,v) = (A,B)
If condition = TRUE
resultSet={(D,F),(A,D),(C,F),
(A,B)}
{D, A, F, C, B}, {E}
Graph G
Kruskal’s Algorithm for MST … Demonstration
Edges = {(D,F), (A,D), (C,F), (A,B), (C,D),
(B,C), (D,E), (E,F), (B,D)}
{D,A,F,C,B}, {E}
resultSet={(D,F),(A,D),(C,F),(A,B)}
(u,v) = (C,D)
If condition = FALSE i.e No change in
resultSet
Graph G
Kruskal’s Algorithm for MST … Demonstration
Edges = {(D,F), (A,D), (C,F), (A,B), (C,D),
(B,C), (D,E), (E,F), (B,D)}
{D,A,F,C,B}, {E}
resultSet={(D,F),(A,D),(C,F),(A,B)}
(u,v) = (B, C)
If condition = FALSE i.e No change in
resultSet
Graph G
Kruskal’s Algorithm for MST … Demonstration
Edges = {(D,F), (A,D), (C,F), (A,B), (C,D),
(B,C), (D,E), (E,F), (B,D)}
(u,v) = (D,E)
If condition = TRUE
resultSet={(D,F),(A,D),(C,F),(A,B),(D,E)}
{D,A,F,C,B,E}
Graph G
Kruskal’s Algorithm for MST … Demonstration
Edges = {(D,F), (A,D), (C,F), (A,B), (C,D), (B,C),
(D,E), (E,F), (B,D)}
(u,v) = (E, F)
resultSet={(D,F),(A,D),(C,F),(A,B),(D,E)}
{D,A,F,C,B,E}
If condition = FALSE i.e. No change in resultSet
Graph G
Kruskal’s Algorithm for MST … Demonstration
Edges = {(D,F), (A,D), (C,F), (A,B), (C,D),
(B,C), (D,E), (E,F), (B,D)}
(u,v) = (B, D)
resultSet={(D,F),(A,D),(C,F),(A,B),(D,E)}
{D,A,F,C,B,E}
If condition = FALSE i.e. No change in
resultSet
Graph G
Kruskal’s Algorithm for MST … Demonstration
resultSet={(D,F),(A,D),(C,F),(A,B),(D,E)}
Graph G
Kruskal’s Algorithm for MST … Complexity
proc primMST(G, r) // G = (V, E)
resultSet = {}
Prim’s Algorithm for MST
resultSet = {}
vertices = {A, B, C, D, E, F}
Prim’s Algorithm for MST
resultSet = {}
vertices = {A, B, C, D, E, F}
A(∞, null), B(∞, null), C(∞, null),
D(∞, null), E(∞, null), F(∞, null)
Prim’s Algorithm for MST
resultSet = {}
vertices = {A, B, C, D, E, F}
A(0, null), B(∞, null), C(∞, null),
D(∞, null), E(∞, null), F(∞, null)
Prim’s Algorithm for MST
resultSet = {}
A(0, null), B(∞, null), C(∞, null),
D(∞, null), E(∞, null), F(∞, null)
u=A
vertices = {B, C, D, E, F} // A is removed
If condition = false // A.parent is null
Prim’s Algorithm for MST
resultSet = {}
vertices = {B, C, D, E, F}
u=A
G.adjacentList = {B, D}
v=B
2nd if condition = true// B belongs to vertices
//AND (A, B).weight < B.key
A(0, null), B(3, A), C(∞, null),
D(∞, null), E(∞, null), F(∞, null)
Prim’s Algorithm for MST
resultSet = {}
vertices = {B, C, D, E, F}
u=A
G.adjacentList = {B, D}
v=D
2nd if condition = true // D belongs to vertices
// AND (A, D).weight < D.key
A(0, null), B(3, A), C(∞, null),
D(2, A), E(∞, null), F(∞, null)
Prim’s Algorithm for MST
While condition is TRUE // vertices is not EMPTY
u=D // key-wise smallest node
vertices = {B, C, E, F} // removed D from vertices
if condition is TRUE // D.parent is not null
//i.e. it is added to resultSet
resultSet = {(A,D)}
A(0, null), B(3, A), C(∞, null),
D(2, A), E(∞, null), F(∞, null)
Prim’s Algorithm for MST
resultSet = {(A,D)}
vertices = {B, C, E, F}
A(0, null), B(3, A), C(∞, null),
D(2, A), E(∞, null), F(∞, null)
u=D
1st If condition = true
u.adjacentList={A, B, C, E, F}
v=A
2nd if condition is false
Prim’s Algorithm for MST
resultSet = {(A,D)}
vertices = {B, C, E, F}
A(0, null), B(3, A), C(∞, null),
D(2, A), E(∞, null), F(∞, null)
u=D
1st If condition = true
u.adjacentList={A, B, C, E, F}
v=B
2nd if condition is false
Prim’s Algorithm for MST
resultSet = {(A,D)}
vertices = {B, C, E, F}
A(0, null), B(3, A), C(3, D),
D(2, A), E(∞, null), F(∞, null)
u=D
1st If condition = true
u.adjacentList={A, B, C, E, F}
v=C
2nd if condition is true
Prim’s Algorithm for MST
resultSet = {(A,D)}
vertices = {B, C, E, F}
A(0, null), B(3, A), C(3, D),
D(2, A), E(4, D), F(∞, null)
u=D
1st If condition = true
u.adjacentList={A, B, C, E, F}
v=E
2nd if condition is true
Prim’s Algorithm for MST
resultSet = {(A,D)}
vertices = {B, C, E, F}
A(0, null), B(3, A), C(3, D),
D(2, A), E(4, D), F(1, D)
u=D
1st If condition = true
u.adjacentList={A, B, C, E, F}
v=F
2nd if condition is true
Prim’s Algorithm for MST
resultSet = {(A,D), (D,F)}
vertices = {B, C, E}
A(0, null), B(3, A), C(3, D),
D(2, A), E(4, D), F(1, D)
u=F
1st If condition = true
Prim’s Algorithm for MST
resultSet = {(A,D), (D,F)}
vertices = {B, C, E}
A(0, null), B(3, A), C(2, F),
D(2, A), E(4, D), F(1, D)
u=F
1st If condition = true
v=C
2nd condition = true
Prim’s Algorithm for MST
resultSet = {(A,D), (D,F)}
vertices = {B, C, E}
A(0, null), B(3, A), C(2, F),
D(2, A), E(4, D), F(1, D)
u=F
1st If condition = true
v=E
2nd condition = false
Prim’s Algorithm for MST
resultSet = {(A,D), (D,F)}
vertices = {B, C, E}
A(0, null), B(3, A), C(2, F),
D(2, A), E(4, D), F(1, D)
u=F
1st If condition = true
v=D
2nd condition = false
Prim’s Algorithm for MST
resultSet = {(A,D), (D,F), (F,C)}
vertices = {B, E}
A(0, null), B(3, A), C(2, F),
D(2, A), E(4, D), F(1, D)
u=C
1st If condition = true
v=B
Prim’s Algorithm for MST
resultSet = {(A,D), (D,F), (F,C)}
vertices = {B, E}
A(0, null), B(3, A), C(2, F),
D(2, A), E(4, D), F(1, D)
u=C
1st If condition = true
v=B
2nd condition = false
Prim’s Algorithm for MST
resultSet = {(A,D), (D,F), (F,C)}
vertices = {B, E}
A(0, null), B(3, A), C(2, F),
D(2, A), E(4, D), F(1, D)
u=C
1st If condition = true
v=F
2nd condition = false
Prim’s Algorithm for MST
resultSet = {(A,D), (D,F), (F,C)}
vertices = {B, E}
A(0, null), B(3, A), C(2, F),
D(2, A), E(4, D), F(1, D)
u=C
1st If condition = true
v=D
2nd condition = false
Prim’s Algorithm for MST
resultSet = {(A,D), (D,F), (F,C), (A,B)}
vertices = {E}
A(0, null), B(3, A), C(2, F),
D(2, A), E(4, D), F(1, D)
u=B
1st If condition = true
Prim’s Algorithm for MST
resultSet = {(A,D), (D,F), (F,C), (A,B)}
vertices = {E}
A(0, null), B(3, A), C(2, F),
D(2, A), E(4, D), F(1, D)
u=B
1st If condition = true
v=A
2nd condition = false
Prim’s Algorithm for MST
resultSet = {(A,D), (D,F), (F,C), (A,B)}
vertices = {E}
A(0, null), B(3, A), C(2, F),
D(2, A), E(4, D), F(1, D)
u=B
1st If condition = true
v=D
2nd condition = false
Prim’s Algorithm for MST
resultSet = {(A,D), (D,F), (F,C), (A,B)}
vertices = {E}
A(0, null), B(3, A), C(2, F),
D(2, A), E(4, D), F(1, D)
u=B
1st If condition = true
v=C
2nd condition = false
Prim’s Algorithm for MST
resultSet = {(A,D), (D,F), (F,C), (A,B), (D,E)}
vertices = {}
A(0, null), B(3, A), C(2, F),
D(2, A), E(4, D), F(1, D)
u=E
1st If condition = true
Prim’s Algorithm for MST
resultSet = {(A,D), (D,F), (F,C), (A,B), (D,E)}
vertices = {}
A(0, null), B(3, A), C(2, F),
D(2, A), E(4, D), F(1, D)
u=E
1st If condition = true
v =D
2nd if condition = false
Prim’s Algorithm for MST
resultSet = {(A,D), (D,F), (F,C), (A,B),
(D,E)}
vertices = {}
A(0, null), B(3, A), C(2, F),
D(2, A), E(4, D), F(1, D)
u=E
1st If condition = true
v =F
2nd if condition = false
Prim’s Algorithm for MST
resultSet = {(A,D), (D,F), (F,C), (A,B), (D,E)}
vertices = {}
A(0, null), B(3, A), C(2, F),
D(2, A), E(4, D), F(1, D)
1st If condition = FALSE
Prim’s Algorithm for MST
∞
Dijkstra’s … The Algorithm … Demonstration
Dijkstra’s … The Algorithm … Demonstration
Dijkstra’s … The Algorithm … Demonstration
Dijkstra’s … The Algorithm … Demonstration
Dijkstra’s … The Algorithm … Demonstration
Execute it yourself
Bellman Ford Algorithm … Demonstration
s=A
vertices = {A, B, C, D, E, F}
All nodes initialized i.e. distance from source to
source is 0 and distance from source to every other
node is ∞
Bellman Ford Algorithm … Demonstration
Edges = {(A, B, 4), (A, D, 6), (B, C, 5), (B, D, 3), (C, E, 2),
(D, E, 7), (D, F, 1), (E, F, -1), (F, A, 5), (F, C, 2)}
Bellman Ford Algorithm … Demonstration
Processing edge = (A, D, 6)
If dist[D] > dist[A] + weight(AD)
∞>0+6 … condition is true
dist[D] is updated to 0+6 and parent of D is assigned A
Edges = {(A, B, 4), (A, D, 6), (B, C, 5), (B, D, 3), (C, E, 2),
(D, E, 7), (D, F, 1), (E, F, -1), (F, A, 5), (F, C, 2)}
Bellman Ford Algorithm … Demonstration
Processing edge = (B, C, 5)
If dist[C] > dist[B] + weight(BC)
∞>4+5 … condition is true
dist[C] is updated to 4+5 and parent of C is assigned B
Edges = {(A, B, 4), (A, D, 6), (B, C, 5), (B, D, 3), (C, E, 2),
(D, E, 7), (D, F, 1), (E, F, -1), (F, A, 5), (F, C, 2)}
Bellman Ford Algorithm … Demonstration
Processing edge = (B, D, 3)
If dist[D] > dist[B] + weight(BD)
6>4+3 … condition is FALSE
No change in data
Edges = {(A, B, 4), (A, D, 6), (B, C, 5), (B, D, 3), (C, E, 2),
(D, E, 7), (D, F, 1), (E, F, -1), (F, A, 5), (F, C, 2)}
Bellman Ford Algorithm … Demonstration
Processing edge = (C, E, 2)
If dist[E] > dist[C] + weight(CE)
∞>9+2 … condition is TRUE
dist[E] is assigned 9+2 and parent of E is assigned C
Edges = {(A, B, 4), (A, D, 6), (B, C, 5), (B, D, 3), (C, E, 2),
(D, E, 7), (D, F, 1), (E, F, -1), (F, A, 5), (F, C, 2)}
Bellman Ford Algorithm … Demonstration
Processing edge = (D, E, 7)
If dist[E] > dist[D] + weight(DE)
11 > 6 + 7 … condition is FALSE
No change in data
Edges = {(A, B, 4), (A, D, 6), (B, C, 5), (B, D, 3), (C, E, 2),
(D, E, 7), (D, F, 1), (E, F, -1), (F, A, 5), (F, C, 2)}
Bellman Ford Algorithm … Demonstration
Processing edge = (D, F, 1)
If dist[F] > dist[D] + weight(DF)
∞>6+1 … condition is TRUE
dist[F] is assigned 6+1 and parent of F is assigned D
Edges = {(A, B, 4), (A, D, 6), (B, C, 5), (B, D, 3), (C, E, 2),
(D, E, 7), (D, F, 1), (E, F, -1), (F, A, 5), (F, C, 2)}
Bellman Ford Algorithm … Demonstration
Processing edge = (E, F, -1)
If dist[F] > dist[E] + weight(EF)
7 > 11 + (-1) … condition is FALSE
No change in data
Edges = {(A, B, 4), (A, D, 6), (B, C, 5), (B, D, 3), (C, E, 2),
(D, E, 7), (D, F, 1), (E, F, -1), (F, A, 5), (F, C, 2)}
Bellman Ford Algorithm … Demonstration
Processing edge = (F, A, 5)
If dist[A] > dist[F] + weight(FA)
0>7+5 … condition is FALSE
No change in data
Edges = {(A, B, 4), (A, D, 6), (B, C, 5), (B, D, 3), (C, E, 2),
(D, E, 7), (D, F, 1), (E, F, -1), (F, A, 5), (F, C, 2)}
Bellman Ford Algorithm … Demonstration
Processing edge = (F, C, 2)
If dist[C] > dist[F] + weight(FC)
9>7+2 … condition is FALSE
No change in data
Edges = {(A, B, 4), (A, D, 6), (B, C, 5), (B, D, 3), (C, E, 2),
(D, E, 7), (D, F, 1), (E, F, -1), (F, A, 5), (F, C, 2)}
Bellman Ford Algorithm … Demonstration
33
A* … The Algorithm
Properties of A*
A* generates an optimal solution if h(n) is an admissible heuristic and the
search space is a tree:
h(n) is admissible if it never overestimates the cost to reach the destination
node
A* generates an optimal solution if h(n) is a consistent heuristic and the
search space is a graph:
h(n) is consistent if for every node n and for every successor node n’ of n:
h(n) ≤ c(n,n’) + h(n’)
h(n)
n
d
c(n,n’) h(n’)
n’
• If h(n) is consistent then h(n) is admissible
•Frequently when h(n) is admissible, it is also consistent
Admissible Heuristics
A heuristic is admissible if it is too optimistic, estimating the cost to be
smaller than it actually is.
Example:
In the road map domain,
is admissible as normally cities are not connected by roads that make straight
lines