Soling's Algorithm
Department of Electrical Engineering
GC University, Lahore
Engr.Salman
0306-4111558
Contents
1. Graph
2. Basic term associate with Graph
3. Spanning Tree
4. Condition for spanning tree
5. Spanning Tree properties
6. Minimum–cost spanning Tree
7. Application of MST
8. Algorithms for Minimum-cost-spanning tree
9. Sollin’s Algorithm
Graph
 Non-Linear data structure
 A graph G is finite set of vertices and edges G(E,V).
 Graph is used to represent many real life application.like
 Models for electrical wiring
 Social network like facebook, linkedln.
 GPS (Global position system)[1]
Application of graph
Terms associate with graph
 Vertex
 Edge
 Directed and un-directed graph
 A-cyclic graph
Edge
Weight
Example of Un-directed graph
Directed a-cyclic graph
Spanning Trees (ST)
 For undirected and connected graph G ,spanning tree T is the subset of G which
contain all vertices and does not have a cycle.[2]
 Example
Connected un-directed graph
Remove edges which are producing cycle.
Spanning Tree
Conditions For Spanning tree
 A graph should be connected
 A disconnected graph does not have any spanning tree, as it cannot be
spanned to all its vertices.
 A graph should have at least more than than three vertices
Properties of Spanning Tree
1. For complete undirected graph
Maximum number of spanning tree= nn-2
1. Spanning tree does not have a cycle.
2. Spanning trees have same number of vertices as graph G.
3. All possible spanning tree have same number of vertices and edges.
4. Spanning tree has n-1 edges.
5. If we add an edge to a spanning tree it creat a cycle.
Minimum-cost spanning trees (MST)
 The cost of a spanning tree would be the sum of the costs of its edges
 A minimum-cost spanning tree is a spanning tree that has the lowest cost
 A minimum cost spanning tree is used to find the shortest path.
 Example
/
Spanning tree
MSTTotal cost=1+2+3+4+5=15 Total cost=2+4+5=11
Total cost=1+2+4=7
Conitnue…
 If all the edges have unit cost then all spanning tree are minimal cost
spanning tree and have same cost.
 Because all the spanning tree have dame number of vertices and edges.
Application of MST
 Minimum spanning trees have direct applications in the design
of networks,.for example
1. computer networks
2. telecommunications networks
3. transportation networks
4. water supply networks
5. electrical grids[3]
Minimax Process
2
2 -3
7 2 8 -3
R
B
Taxonomy
Algorithms to find MST
1. Kruskal’s algorithm
2. Prim’s algorithm
3. Sollin’s algorithm
Sollin’s Algorithm
 Sollin’s algorithm is also called Boruvka’s algorithm
 It is used to find MST.
 It was given by Boruvkas in 1926.at tthat time it was the first algorithm to
find the MST.
 Boruvka’s Algorithm is a greedy algorithm and is similar to Kruskal’s
algorithm and Prim’s algorithm. [4]
Greedy Algorithm
 Algorithm are designed to solve the problem.
 In greedy algorithm ,first off all we check all the possibilities of a given
problem, then at the first stage we select that which can give optimal
solution .
 At the next stage always choose the next piece that offers the most benefit.
 Greedy algorithm is an algorithm that builds up a solution piece by piece.
Steps of Sollin’s Algorithm
1. Write all vertices of a connected graph.
2. Highlight the cheapest outgoing edge of all vertices.
3. Choose only one cheapest edge for each vertex.
4. Repeat the algorithm for each sub graph (each differently colored set). This time, for
each node, choose the cheapest edge outside of the sub-graph.
5. If an edge is already selected then skip it.
0
5
1
6
4
3
2
10
28
14 16
12
18
22
25
24
Connected graph
5
1
6
4
3
2
0
10
14
12
22
25
16
MST
Example
Undirected graph Cost =87
Conti…
MST Cost=62
References
 [1]
www.uow.edu.au/~bmaloney/wuct121/GraphsWeek11Lecture2.pdf
 [2]-
https://www.tutorialspoint.com/data_structures_algorithms/spanning_tree.h
tm
 [3]-
https://www.tutorialspoint.com/data_structures_algorithms/spanning_tree.h
tm
 [4]-Fundamental of data structure by in c++ by Sartaj //ch#6 pp#361
ANY QUESTION ??

1 sollins algorithm

  • 1.
    Soling's Algorithm Department ofElectrical Engineering GC University, Lahore Engr.Salman 0306-4111558
  • 2.
    Contents 1. Graph 2. Basicterm associate with Graph 3. Spanning Tree 4. Condition for spanning tree 5. Spanning Tree properties 6. Minimum–cost spanning Tree 7. Application of MST 8. Algorithms for Minimum-cost-spanning tree 9. Sollin’s Algorithm
  • 3.
    Graph  Non-Linear datastructure  A graph G is finite set of vertices and edges G(E,V).  Graph is used to represent many real life application.like  Models for electrical wiring  Social network like facebook, linkedln.  GPS (Global position system)[1] Application of graph
  • 4.
    Terms associate withgraph  Vertex  Edge  Directed and un-directed graph  A-cyclic graph Edge Weight Example of Un-directed graph Directed a-cyclic graph
  • 5.
    Spanning Trees (ST) For undirected and connected graph G ,spanning tree T is the subset of G which contain all vertices and does not have a cycle.[2]  Example Connected un-directed graph Remove edges which are producing cycle. Spanning Tree
  • 6.
    Conditions For Spanningtree  A graph should be connected  A disconnected graph does not have any spanning tree, as it cannot be spanned to all its vertices.  A graph should have at least more than than three vertices
  • 7.
    Properties of SpanningTree 1. For complete undirected graph Maximum number of spanning tree= nn-2 1. Spanning tree does not have a cycle. 2. Spanning trees have same number of vertices as graph G. 3. All possible spanning tree have same number of vertices and edges. 4. Spanning tree has n-1 edges. 5. If we add an edge to a spanning tree it creat a cycle.
  • 8.
    Minimum-cost spanning trees(MST)  The cost of a spanning tree would be the sum of the costs of its edges  A minimum-cost spanning tree is a spanning tree that has the lowest cost  A minimum cost spanning tree is used to find the shortest path.  Example / Spanning tree MSTTotal cost=1+2+3+4+5=15 Total cost=2+4+5=11 Total cost=1+2+4=7
  • 9.
    Conitnue…  If allthe edges have unit cost then all spanning tree are minimal cost spanning tree and have same cost.  Because all the spanning tree have dame number of vertices and edges.
  • 10.
    Application of MST Minimum spanning trees have direct applications in the design of networks,.for example 1. computer networks 2. telecommunications networks 3. transportation networks 4. water supply networks 5. electrical grids[3]
  • 11.
  • 12.
  • 13.
    Algorithms to findMST 1. Kruskal’s algorithm 2. Prim’s algorithm 3. Sollin’s algorithm
  • 14.
    Sollin’s Algorithm  Sollin’salgorithm is also called Boruvka’s algorithm  It is used to find MST.  It was given by Boruvkas in 1926.at tthat time it was the first algorithm to find the MST.  Boruvka’s Algorithm is a greedy algorithm and is similar to Kruskal’s algorithm and Prim’s algorithm. [4]
  • 15.
    Greedy Algorithm  Algorithmare designed to solve the problem.  In greedy algorithm ,first off all we check all the possibilities of a given problem, then at the first stage we select that which can give optimal solution .  At the next stage always choose the next piece that offers the most benefit.  Greedy algorithm is an algorithm that builds up a solution piece by piece.
  • 16.
    Steps of Sollin’sAlgorithm 1. Write all vertices of a connected graph. 2. Highlight the cheapest outgoing edge of all vertices. 3. Choose only one cheapest edge for each vertex. 4. Repeat the algorithm for each sub graph (each differently colored set). This time, for each node, choose the cheapest edge outside of the sub-graph. 5. If an edge is already selected then skip it. 0 5 1 6 4 3 2 10 28 14 16 12 18 22 25 24 Connected graph 5 1 6 4 3 2 0 10 14 12 22 25 16 MST
  • 17.
  • 18.
  • 19.
    References  [1] www.uow.edu.au/~bmaloney/wuct121/GraphsWeek11Lecture2.pdf  [2]- https://www.tutorialspoint.com/data_structures_algorithms/spanning_tree.h tm [3]- https://www.tutorialspoint.com/data_structures_algorithms/spanning_tree.h tm  [4]-Fundamental of data structure by in c++ by Sartaj //ch#6 pp#361
  • 20.