nl.uu.cs.treewidth.graph
Class NeighborHashSetGraph<Data>

java.lang.Object
  extended by nl.uu.cs.treewidth.graph.NeighborHashSetGraph<Data>
Type Parameters:
Data -

Deprecated.

@Deprecated
public class NeighborHashSetGraph<Data>
extends java.lang.Object

Deprecated! Use the NGraph instead.

Standard datastructure for representing graphs. Its main use is as a standardized way to communicate graphs throughout the framework. (For example, a GraphInput returns a Graph and an Algorithm gets its input as a Graph.)

TODO More explanation of how the datastructure works.

Example usage: Read a graph from a file in DGF format.

 GraphInput input = new DgfReader( "myGraph.dgf" );
 Graph g = new Graph();
 try {
 
     g = input.get();
     
 } catch (InputException e) { ... }
 

Example usage: Manually create C3

 Graph g = new Graph();
 
 Vertex v1 = new Vertex();
 g.addVertex( v1 );
 
 Vertex v2 = new Vertex();
 g.addVertex( v2 );
 
 Vertex v3 = new Vertex();
 g.addVertex( v3 );
 
 g.addEdge( v1, v2 );
 g.addEdge( v2, v3 );
 g.addEdge( v3, v1 );
 

Author:
tw team

Nested Class Summary
static interface NeighborHashSetGraph.Convertor<OldData,NewData>
          Deprecated.  
static class NeighborHashSetGraph.Copier<CopiedData>
          Deprecated. Does NOT make a deep copy of the vertices' data.
 
Field Summary
 Graph<Data> original
          Deprecated.  
 java.util.ArrayList<NeighborHashSetVertex<Data>> vertices
          Deprecated. List of the vertices of the graph.
 
Constructor Summary
NeighborHashSetGraph()
          Deprecated. Creates an empty graph with no comments.
NeighborHashSetGraph(Graph<? extends OldData> g, Graph.Convertor<OldData,Data> dataConvertor)
          Deprecated.  
NeighborHashSetGraph(Graph<Data> g)
          Deprecated.  
 
Method Summary
 void addComment(java.lang.String c)
          Deprecated. Adds a new line of comments to the graph.
 void addEdge(NeighborHashSetVertex<Data> a, NeighborHashSetVertex<Data> b)
          Deprecated. Adds an edge between a and b in the graph.
 void addVertex(NeighborHashSetVertex<Data> v)
          Deprecated. Adds a vertex to the graph.
 void clearEdgeCache()
          Deprecated. Makes sure the cached edgelist is no longer used.
 void contractEdge(NeighborHashSetVertex<Data> vertex1, NeighborHashSetVertex<Data> vertex2)
          Deprecated.  
static
<OldData,NewData>
NeighborHashSetGraph<NewData>
copy(NeighborHashSetGraph<OldData> oldG, NeighborHashSetGraph.Convertor<OldData,NewData> dataConvertor)
          Deprecated.  
 void deEliminateVertex(NeighborHashSetVertex<Data> v, java.util.ArrayList<NeighborHashSetEdge<Data>> addedEdges)
          Deprecated.  
<T> void
eliminateVertex(NeighborHashSetVertex<T> v)
          Deprecated. Eliminates a vertex from the copy of the graph by marrying the neighbors and removing the vertex.
<T> java.util.ArrayList<NeighborHashSetEdge<T>>
eliminateVertex2(NeighborHashSetVertex<T> v)
          Deprecated. Warning - Testingfunction for QuickBB3 : Work in progress
 java.lang.String getComments()
          Deprecated.  
 java.util.ArrayList<NeighborHashSetEdge<Data>> getEdges()
          Deprecated. Computes the edgelist of the graph.
 java.util.ArrayList<NeighborHashSetVertex<Data>> getSimplicialVertices()
          Deprecated.  
 void removeEdge(NeighborHashSetEdge<Data> e)
          Deprecated.  
 void removeVertex(NeighborHashSetVertex<Data> v)
          Deprecated.  
static
<CopiedData>
NeighborHashSetGraph<CopiedData>
shallowCopy(NeighborHashSetGraph<CopiedData> g)
          Deprecated.  
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

original

public Graph<Data> original
Deprecated. 

vertices

public java.util.ArrayList<NeighborHashSetVertex<Data>> vertices
Deprecated. 
List of the vertices of the graph.

Constructor Detail

NeighborHashSetGraph

public NeighborHashSetGraph()
Deprecated. 
Creates an empty graph with no comments.


NeighborHashSetGraph

public NeighborHashSetGraph(Graph<Data> g)
Deprecated. 

NeighborHashSetGraph

public NeighborHashSetGraph(Graph<? extends OldData> g,
                            Graph.Convertor<OldData,Data> dataConvertor)
Deprecated. 
Method Detail

addVertex

public void addVertex(NeighborHashSetVertex<Data> v)
Deprecated. 
Adds a vertex to the graph.

Parameters:
v - The vertex to add.

addEdge

public void addEdge(NeighborHashSetVertex<Data> a,
                    NeighborHashSetVertex<Data> b)
Deprecated. 
Adds an edge between a and b in the graph.

Parameters:
a -
b -

addComment

public void addComment(java.lang.String c)
Deprecated. 
Adds a new line of comments to the graph. (Note that a newline is automatically prefixed.)

Parameters:
c - The comment line

getComments

public java.lang.String getComments()
Deprecated. 
Returns:
The comments for this graph.

getEdges

public java.util.ArrayList<NeighborHashSetEdge<Data>> getEdges()
Deprecated. 
Computes the edgelist of the graph.
Caution: This method uses cached data. If you manually change the vertices in the graph, call the function clearEdgeCache() to make sure the cached data is not used.

Returns:
Edgelist of the graph.

shallowCopy

public static <CopiedData> NeighborHashSetGraph<CopiedData> shallowCopy(NeighborHashSetGraph<CopiedData> g)
Deprecated. 

copy

public static <OldData,NewData> NeighborHashSetGraph<NewData> copy(NeighborHashSetGraph<OldData> oldG,
                                                                   NeighborHashSetGraph.Convertor<OldData,NewData> dataConvertor)
Deprecated. 

contractEdge

public void contractEdge(NeighborHashSetVertex<Data> vertex1,
                         NeighborHashSetVertex<Data> vertex2)
Deprecated. 

removeVertex

public void removeVertex(NeighborHashSetVertex<Data> v)
Deprecated. 

eliminateVertex

public <T> void eliminateVertex(NeighborHashSetVertex<T> v)
Deprecated. 
Eliminates a vertex from the copy of the graph by marrying the neighbors and removing the vertex.
This method does NOT update the edgelist of the copy of the graph, because it is not used.

Parameters:
v - The vertex to remove from the copy of the graph.

clearEdgeCache

public void clearEdgeCache()
Deprecated. 
Makes sure the cached edgelist is no longer used. Call this function if you change something in the vertices of the graph without using the methods in Graph.


eliminateVertex2

public <T> java.util.ArrayList<NeighborHashSetEdge<T>> eliminateVertex2(NeighborHashSetVertex<T> v)
Deprecated. 
Warning - Testingfunction for QuickBB3 : Work in progress


deEliminateVertex

public void deEliminateVertex(NeighborHashSetVertex<Data> v,
                              java.util.ArrayList<NeighborHashSetEdge<Data>> addedEdges)
Deprecated. 

removeEdge

public void removeEdge(NeighborHashSetEdge<Data> e)
Deprecated. 

getSimplicialVertices

public java.util.ArrayList<NeighborHashSetVertex<Data>> getSimplicialVertices()
Deprecated.