Code Examples
  Home arrow Code Examples arrow Articulation Edges and Vertexes
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
CODE EXAMPLES

Articulation Edges and Vertexes
By: Gabor Bernat
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2009-05-21

    Table of Contents:
  • Articulation Edges and Vertexes
  • Articulation Edges: Code Snippet
  • Articulation Vertexes: Theory
  • Articulation Vertexes: Code Snippet

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Articulation Edges and Vertexes


    (Page 1 of 4 )

    In the lives of each of us there exist some key moments that uniquely define us and become symbolic. These are the critical points; without these, all that we know now would drastically change. Articulation edges and vertexes are something like this to graphs; however, finding them is a lot more complicated than it may seem at first.

    This is the sixth part of the article series I am dedicating to graph techniques, so if you missed any of the earlier ones I invite you to search for them on this site and read them as well. For this article, it is critical that you understand the Depth First Search algorithm, as the solution heavily relies on it; in fact, it is a prime example of how, by changing the DFS and accommodating it to our needs, we can resolve complex problems.

    Any edge which, if we delete it, will increase the connective components count inside the graph, is an articulation edge. We define this as graphs that have edges with no direction.

    To translate this to a little more practical problem, let's assume a war. If we represent the road system with a graph, these roads will be the strategically points whose removal will allow us to divide the enemy. To find the solution, let us first define what can be an articulation edge.

    An edge from vertex u to node v is an articulation edge only if it is part of the tree edge formed during the DFS (recall the classification of the edges from the previous articles), and from the sub-tree of the v there are no edges that point back to a parent of the vertex u.

    A back-pointing edge would place the edge on a circle, and if we delete any edge from a circle, we can still travel from any edge to any other edge, so the first part is obvious. Here you should also know that in a graph with no directed edges, there will not be any forward-pointing or cross-pointing edges.

    Moreover, if we have an edge pointing back in the sub-tree of v to a parent of the u, that would place the edge on a circle, and so double the u -v edge connection. This would lose the articulation edge property, because by deleting it we could use the back-pointing edge to travel to any of the nodes of the parents of u.

    The earliest point at which we may have this information in our grasp is when we come back from the neighbor edges in a DFS, and we are setting the color of the vertex to black. We will transform the DFS from method to function, and a DFS call to a vertex. Each will return the highest level where there exists a back-pointing edge in the sub-tree.

    For an easier determination of the level, we will add an additional parameter to the DFS function, one that will show our current level. If there are no back-pointing edges, the function will send back infinity (limited in our code to INT_MAX).

    When we dropped by all of neighbors of a vertex, the level of the sub-tree's minimal back-pointing edge will be the lowest from the ones returned by the children of u. If this is infinity, the u-v edge is an articulation edge, as v-u will not be a back-pointing edge, because it already is part of the tree.

    More Code Examples Articles
    More By Gabor Bernat


     

    CODE EXAMPLES ARTICLES

    - Bipartite Graphs
    - Connectivity in Graphs
    - The Ford-Fulkerson Algorithm
    - Critical Paths
    - The Bellman-Ford and Roy-Floyd Algorithms
    - Shortest Path Algorithms in Graphs
    - Minimum Spanning Tree
    - Articulation Edges and Vertexes
    - Circles and Connectivity in Graphs
    - Depth-First Search in Graphs
    - Breadth-First Search in Graphs
    - The Prufer Code and the Floyd-Warshall Algor...
    - An Insight into Graphs
    - Coding a Custom Object with WSC
    - Creating a Custom Object with WSC





    © 2003-2010 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek