org.jgrapht.alg

## Class GabowStrongConnectivityInspector<V,E>

- java.lang.Object
- - org.jgrapht.alg.GabowStrongConnectivityInspector<V,E>

- All Implemented Interfaces:
    StrongConnectivityAlgorithm<V,E>

      public class GabowStrongConnectivityInspector<V,E>
      extends Object
      implements StrongConnectivityAlgorithm<V,E>

  Allows obtaining the strongly connected components of a directed graph. The implemented algorithm follows Cheriyan-Mehlhorn/Gabow's algorithm Presented in Path-based depth-first search for strong and biconnected components by Gabow (2000). The running time is order of O(|V|+|E|)
  Since:
    September, 2013
  Author:
    Sarah Komla-Ebri

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `GabowStrongConnectivityInspector(DirectedGraph<V,E> directedGraph)` The constructor of GabowStrongConnectivityInspector class.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `DirectedGraph<V,E>` | `getGraph()` Returns the graph inspected
    `boolean` | `isStronglyConnected()` Returns true if the graph instance is strongly connected.
    `List<Set<V>>` | `stronglyConnectedSets()` Computes a `List` of `Set`s, where each set contains vertices which together form a strongly connected component within the given graph.
    `List<DirectedSubgraph<V,E>>` | `stronglyConnectedSubgraphs()` Computes a list of `DirectedSubgraph`s of the given graph.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### GabowStrongConnectivityInspector

          public GabowStrongConnectivityInspector(DirectedGraph<V,E> directedGraph)

      The constructor of GabowStrongConnectivityInspector class.
      Parameters:
        `directedGraph` - the graph to inspect
      Throws:
        `IllegalArgumentException`

  - ### Method Detail

    - #### getGraph

          public DirectedGraph<V,E> getGraph()

      Returns the graph inspected
      Specified by:
        `getGraph` in interface `StrongConnectivityAlgorithm<V,E>`
      Returns:
        the graph inspected

    - #### isStronglyConnected

          public boolean isStronglyConnected()

      Returns true if the graph instance is strongly connected.
      Specified by:
        `isStronglyConnected` in interface `StrongConnectivityAlgorithm<V,E>`
      Returns:
        true if the graph is strongly connected, false otherwise

    - #### stronglyConnectedSets

          public List<Set<V>> stronglyConnectedSets()

      Computes a `List` of `Set`s, where each set contains vertices which together form a strongly connected component within the given graph.
      Specified by:
        `stronglyConnectedSets` in interface `StrongConnectivityAlgorithm<V,E>`
      Returns:
        `List` of `Set` s containing the strongly connected components

    - #### stronglyConnectedSubgraphs

          public List<DirectedSubgraph<V,E>> stronglyConnectedSubgraphs()

      Computes a list of `DirectedSubgraph`s of the given graph. Each subgraph will represent a strongly connected component and will contain all vertices of that component. The subgraph will have an edge (u,v) iff u and v are contained in the strongly connected component.

      NOTE: Calling this method will first execute `stronglyConnectedSets()`. If you don't need subgraphs, use that method.

      Specified by:
        `stronglyConnectedSubgraphs` in interface `StrongConnectivityAlgorithm<V,E>`
      Returns:
        a list of subgraphs representing the strongly connected components

Copyright © 2016. All rights reserved.