choco.cp.solver.constraints.global.tree.structure.internalStructure.graphStructures.graphViews
Class StoredBitSetGraph

java.lang.Object
  extended by choco.cp.solver.constraints.global.tree.structure.internalStructure.graphStructures.graphViews.StoredBitSetGraph

public class StoredBitSetGraph
extends Object

the core class that allow to represent a graph and a set of properties that can be dynamically maintained.


Nested Class Summary
static class StoredBitSetGraph.Maintain
          list of graph properties that can be maintained for a given graph
 
Field Summary
protected  boolean affiche
          boolean for debug and show a trace of the execution
protected  ConnectedComponents cc
          connected component structure associated with the graph
protected  int[] dfsTree
          resulting labelling of the nodes involved in the graph according to a depth first search
protected  IStateBitSet[] graph
          backtrackable bitset matrix representing the graph
protected  int idx
          reference idx in a depth first search
protected static Logger LOGGER
           
protected  IStateInt nbCC
          backtrackable integer recording the current number of connected components
protected  int nbNodes
          total number of nodes involved in the graph
protected  boolean needUpdate
           
protected  IStateBitSet[] numFromVertCC
           
protected  List<StoredBitSetGraph.Maintain> params
          list of graph properties to maintain for the graph
protected  IStateBitSet[] revGraph
          backtrackable bitset matrix representing the reverse graph
protected  IStateBitSet[] revTcGraph
          backtrackable bitset matrix representing the reverse transitive closure of the graph
protected  IStateBitSet[] revTrGraph
          backtrackable bitset matrix representing the reverse transitive reduction of the graph
protected  Vector<IStateBitSet> setCC
           
protected  IStateBitSet sinkNodes
          backtrackable bitset that store the sink nodes of the graph
protected  Solver solver
          Choco solver embedding the tree constraint
protected  IStateBitSet srcNodes
          backtrackable bitset that store the source nodes of the graph
protected  IStateBitSet[] tcGraph
          backtrackable bitset matrix representing the transitive closure of the graph
protected  IStateBitSet[] trGraph
          backtrackable bitset matrix representing the transitive reduction of the graph
protected  IStateBitSet[] vertFromNumCC
           
 
Constructor Summary
StoredBitSetGraph(Solver solver, IStateBitSet[] graph, List<StoredBitSetGraph.Maintain> params, boolean affiche)
           
 
Method Summary
 void addArc(int u, int v)
          add the arc (u,v) in the graph view structure (required properties are dynamically updated)
 void affiche()
           
 IStateBitSet getAncestors(int i)
           
 IStateBitSet getDescendants(int i)
           
 IStateBitSet[] getGraph()
           
 int getGraphSize()
           
 IStateInt getNbCC()
           
 IStateBitSet[] getNumFromVertCC()
           
 IStateBitSet getPredecessors(int i)
           
 IStateBitSet[] getRevGraph()
           
 IStateBitSet[] getRevTcGraph()
           
 IStateBitSet[] getRevTrGraph()
           
 Vector<IStateBitSet> getSetCC()
           
 IStateBitSet getSinkNodes()
           
 IStateBitSet getSrcNodes()
           
 IStateBitSet getSuccessors(int i)
           
 IStateBitSet[] getTcGraph()
           
 IStateBitSet[] getTrGraph()
           
 IStateBitSet[] getVertFromNumCC()
           
 void razGraph()
           
 void remAllExcepted(int u, int v)
          remove all the successors of node u, excepted node v, from the graph view structure (required properties are dynamically updated)
 void remAllGreaterIdx(int u, int idx)
          remove all the successors of node u that have an index higher than idx (required properties are dynamically updated)
 void remAllIdx(int u, int inf, int sup)
          remove all the successors of node u that have an index below to inf and higher than sup (required properties are dynamically updated)
 void remAllLowerIdx(int u, int idx)
          remove all the successors of node u that have an index below to idx (required properties are dynamically updated)
 void remAllNodes(int u, DisposableIntIterator deltaDomain)
          all the arc (u,v), such that v belongs to the set depicted by the iterator, are removed
 void remAllSucc(int u)
          remove all the successors of node u from the graph view structure (required properties are dynamically updated)
 void remArc(int u, int v)
          remove the arc (u,v) from the graph view structure (required properties are dynamically updated)
 void setGraph(IStateBitSet[] newGraph)
           
 void showAllDesc(String type)
           
 String showDesc(int i, String type)
           
 void showGraph(String type)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGER

protected static final Logger LOGGER

solver

protected Solver solver
Choco solver embedding the tree constraint


params

protected List<StoredBitSetGraph.Maintain> params
list of graph properties to maintain for the graph


nbNodes

protected int nbNodes
total number of nodes involved in the graph


idx

protected int idx
reference idx in a depth first search


dfsTree

protected int[] dfsTree
resulting labelling of the nodes involved in the graph according to a depth first search


graph

protected IStateBitSet[] graph
backtrackable bitset matrix representing the graph


revGraph

protected IStateBitSet[] revGraph
backtrackable bitset matrix representing the reverse graph


tcGraph

protected IStateBitSet[] tcGraph
backtrackable bitset matrix representing the transitive closure of the graph


revTcGraph

protected IStateBitSet[] revTcGraph
backtrackable bitset matrix representing the reverse transitive closure of the graph


needUpdate

protected boolean needUpdate

trGraph

protected IStateBitSet[] trGraph
backtrackable bitset matrix representing the transitive reduction of the graph


revTrGraph

protected IStateBitSet[] revTrGraph
backtrackable bitset matrix representing the reverse transitive reduction of the graph


srcNodes

protected IStateBitSet srcNodes
backtrackable bitset that store the source nodes of the graph


sinkNodes

protected IStateBitSet sinkNodes
backtrackable bitset that store the sink nodes of the graph


cc

protected ConnectedComponents cc
connected component structure associated with the graph


setCC

protected Vector<IStateBitSet> setCC

vertFromNumCC

protected IStateBitSet[] vertFromNumCC

numFromVertCC

protected IStateBitSet[] numFromVertCC

nbCC

protected IStateInt nbCC
backtrackable integer recording the current number of connected components


affiche

protected boolean affiche
boolean for debug and show a trace of the execution

Constructor Detail

StoredBitSetGraph

public StoredBitSetGraph(Solver solver,
                         IStateBitSet[] graph,
                         List<StoredBitSetGraph.Maintain> params,
                         boolean affiche)
Method Detail

addArc

public void addArc(int u,
                   int v)
add the arc (u,v) in the graph view structure (required properties are dynamically updated)

Parameters:
u - index of a node
v - index of a node

remArc

public void remArc(int u,
                   int v)
remove the arc (u,v) from the graph view structure (required properties are dynamically updated)

Parameters:
u - index of a node
v - index of a node

remAllSucc

public void remAllSucc(int u)
remove all the successors of node u from the graph view structure (required properties are dynamically updated)

Parameters:
u - index of a node

remAllExcepted

public void remAllExcepted(int u,
                           int v)
remove all the successors of node u, excepted node v, from the graph view structure (required properties are dynamically updated)

Parameters:
u - index of a node
v - index of a node

remAllLowerIdx

public void remAllLowerIdx(int u,
                           int idx)
remove all the successors of node u that have an index below to idx (required properties are dynamically updated)

Parameters:
u - index of a node
idx - integer value

remAllGreaterIdx

public void remAllGreaterIdx(int u,
                             int idx)
remove all the successors of node u that have an index higher than idx (required properties are dynamically updated)

Parameters:
u - index of a node
idx - integer value

remAllIdx

public void remAllIdx(int u,
                      int inf,
                      int sup)
remove all the successors of node u that have an index below to inf and higher than sup (required properties are dynamically updated)

Parameters:
u - index of a node
inf - integer value
sup - integer value

remAllNodes

public void remAllNodes(int u,
                        DisposableIntIterator deltaDomain)
all the arc (u,v), such that v belongs to the set depicted by the iterator, are removed

Parameters:
u - index of a node
deltaDomain - an iterator over the removed indices

getGraphSize

public int getGraphSize()

getSuccessors

public IStateBitSet getSuccessors(int i)

getPredecessors

public IStateBitSet getPredecessors(int i)

getDescendants

public IStateBitSet getDescendants(int i)

getAncestors

public IStateBitSet getAncestors(int i)

getGraph

public IStateBitSet[] getGraph()

setGraph

public void setGraph(IStateBitSet[] newGraph)

razGraph

public void razGraph()

getRevGraph

public IStateBitSet[] getRevGraph()

getTcGraph

public IStateBitSet[] getTcGraph()

getRevTcGraph

public IStateBitSet[] getRevTcGraph()

getTrGraph

public IStateBitSet[] getTrGraph()

getRevTrGraph

public IStateBitSet[] getRevTrGraph()

getSrcNodes

public IStateBitSet getSrcNodes()

getSinkNodes

public IStateBitSet getSinkNodes()

getSetCC

public Vector<IStateBitSet> getSetCC()

getVertFromNumCC

public IStateBitSet[] getVertFromNumCC()

getNumFromVertCC

public IStateBitSet[] getNumFromVertCC()

getNbCC

public IStateInt getNbCC()

showDesc

public String showDesc(int i,
                       String type)

showAllDesc

public void showAllDesc(String type)

showGraph

public void showGraph(String type)

affiche

public void affiche()


Copyright © 2012. All Rights Reserved.