fr.inria.opengve.bridge.algorithms
Class GraphUtility

java.lang.Object
  extended by fr.inria.opengve.bridge.algorithms.GraphUtility

public class GraphUtility
extends java.lang.Object

This static class permit to verify various graph properties.

Author:
mservetto, fabrice.peix@sophia.inria.fr

Nested Class Summary
static class GraphUtility.Propriety
          All possible properties that can be tested.
 
Method Summary
static
<V,L extends Link<V>>
boolean
checkProprieties(Graph<V,L> graph, GraphUtility.Propriety... propieties)
          Check if a graph have a given list of properties.
static
<V,L extends Link<V>>
void
copyGraphInGraph(Graph<V,L> graph, Graph<V,L> emptyGraph)
          This method must return a subset-free copy of the graph.
static
<V,L extends Link<V>>
boolean
haveLoopLinks(Graph<V,L> graph)
          Test if a given graph contains a loop.
static
<V,L extends Link<V>>
boolean
isConnectedGraph(Graph<V,L> graph, boolean stronglyConnectedRequired)
          Test the connectivity of a given graph.
static
<V,L extends Link<V>>
boolean
isMultiGraph(Graph<V,L> graph)
          Test if a given graph is a multigraph.
static
<V,L extends Link<V>>
HierarchicalSet<L>
rechabilityLinks(V startingVertex, Graph<V,L> graph)
          Give the set of all reachable links from a given starting vertex.
static
<V,L extends Link<V>>
HierarchicalSet<V>
rechabilityVertices(V startingVertex, Graph<V,L> graph, boolean includeStatingPoint)
          Give the set of vertices reachable from a given one.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

checkProprieties

public static <V,L extends Link<V>> boolean checkProprieties(Graph<V,L> graph,
                                                             GraphUtility.Propriety... propieties)
Check if a graph have a given list of properties.

Parameters:
graph - The graph.
propieties - The properties that must be check.
Returns:
true if the graph check all properties and false otherwise.

rechabilityVertices

public static <V,L extends Link<V>> HierarchicalSet<V> rechabilityVertices(V startingVertex,
                                                                           Graph<V,L> graph,
                                                                           boolean includeStatingPoint)
Give the set of vertices reachable from a given one. You must note that the returned set is a subset of the graph vertex set.

Parameters:
startingVertex - The starting vertex.
graph - The graph.
includeStatingPoint - boolean saying if the starting point must be also added to the resulting set.
Returns:
The set of vertices reachable from the starting one.

rechabilityLinks

public static <V,L extends Link<V>> HierarchicalSet<L> rechabilityLinks(V startingVertex,
                                                                        Graph<V,L> graph)
Give the set of all reachable links from a given starting vertex. You must note that the resulting set if a subset of the graph link set.

Parameters:
startingVertex - The starting vertex.
graph - The graph.
Returns:
The set of reachable link from the starting vertex.

copyGraphInGraph

public static <V,L extends Link<V>> void copyGraphInGraph(Graph<V,L> graph,
                                                          Graph<V,L> emptyGraph)
This method must return a subset-free copy of the graph.

Parameters:
graph - a start graph
emptyGraph - a graph initally empty that will became a copy of graph

isMultiGraph

public static <V,L extends Link<V>> boolean isMultiGraph(Graph<V,L> graph)
Test if a given graph is a multigraph.

Parameters:
graph - The graph.
Returns:
true if the given graph is a multigraph and false otherwise.

isConnectedGraph

public static <V,L extends Link<V>> boolean isConnectedGraph(Graph<V,L> graph,
                                                             boolean stronglyConnectedRequired)
Test the connectivity of a given graph.

Type Parameters:
V - The type of vertices
L - The type of links
Parameters:
graph - The graph.
stronglyConnectedRequired - true for testing strongly connectivity and false otherwise.
Returns:
true if the property is verified and false otherwise.

haveLoopLinks

public static <V,L extends Link<V>> boolean haveLoopLinks(Graph<V,L> graph)
Test if a given graph contains a loop.

Parameters:
graph - The graph.
Returns:
true if the graph contain at least a loop and false otherwise.


Copyright © 2009 INRIA (Projet Mascotte). All Rights Reserved.