de.aitools.aq.graph.weighted.concrete
Class ConcreteUndirectedIntGraph

java.lang.Object
  extended by de.aitools.aq.graph.weighted.concrete.ConcreteUndirectedIntGraph
All Implemented Interfaces:
UndirectedIntGraph, UndirectedMutableIntGraph

Deprecated. see package de.aitools.aq.structure.graph

public final class ConcreteUndirectedIntGraph
extends java.lang.Object
implements UndirectedMutableIntGraph

A general implementation for int vertices. Each weight is stored only once in the graph.

Version:
$Id: ConcreteUndirectedIntGraph.java,v 1.2 2011/09/29 12:43:04 dogu3912 Exp $
Author:
johannes.kiesel(/\t)uni-weimar.de

Nested Class Summary
 
Nested classes/interfaces inherited from interface de.aitools.aq.graph.weighted.UndirectedMutableIntGraph
UndirectedMutableIntGraph.Edge
 
Field Summary
 
Fields inherited from interface de.aitools.aq.graph.weighted.UndirectedIntGraph
DEFAULT_UNCONNECTED_WEIGHT
 
Constructor Summary
ConcreteUndirectedIntGraph()
          Deprecated. Create a new ConcreteUndirectedIntGraph with default weight for unconnected vertices and default capacity.
ConcreteUndirectedIntGraph(double unconnectedWeight, int initialCapacity)
          Deprecated. Create a new ConcreteUndirectedIntGraph.
ConcreteUndirectedIntGraph(int initialCapacity)
          Deprecated. Create a new ConcreteUndirectedIntGraph with default weight for unconnected vertices.
 
Method Summary
 boolean addVertex(int vertex)
          Deprecated. Add a vertex to the graph.
 boolean containsEdge(int vertexA, int vertexB)
          Deprecated. Check if there exists an edge in the graph connecting the two vertices given as parameters.
 boolean containsVertex(int vertex)
          Deprecated. Check if given vertex is contained in the graph.
 java.util.Iterator<? extends UndirectedMutableIntGraph.Edge> edges()
          Deprecated. Get an iterator over all edges of the graph.
 java.util.Iterator<? extends UndirectedMutableIntGraph.Edge> edgesConnectedTo(int vertex)
          Deprecated. Get an iterator over all edges in the graph, given vertex is connected with.
 UndirectedMutableIntGraph.Edge getEdge(int vertexA, int vertexB)
          Deprecated. Get the UndirectedIntGraph.Edge connecting the two vertices.
 double getEdgeWeight(int vertexA, int vertexB)
          Deprecated. Get the weight of the edge connecting the two vertices.
 double getUnconnectedWeight()
          Deprecated. The method UndirectedIntGraph.getEdgeWeight(int, int) returns a double value for any possible edge connecting two vertices in the graph.
 int numEdges()
          Deprecated. Get the number of edges.
 int numEdges(int vertex)
          Deprecated.  
 int numVertices()
          Deprecated. Get the number of vertices.
 double removeEdge(int vertexA, int vertexB)
          Deprecated. Remove a edge determined by two vertices.
 boolean removeVertex(int vertex)
          Deprecated. Remove a vertex from the graph.
 double setEdgeWeight(int vertexA, int vertexB, double weight)
          Deprecated. Set the weight of a edge determined by two vertices.
 void setUnconnectedWeight(double unconnectedWeight)
          Deprecated. Change the weight that is returned by UndirectedIntGraph.getEdgeWeight(int, int) if the two vertices are not connected.
 int[] vertices()
          Deprecated. Get an array containing all current vertices of this graph.
 int[] verticesConnectedTo(int vertex)
          Deprecated. Get an array containing all vertices that are connected with given vertex at the moment of this call.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConcreteUndirectedIntGraph

public ConcreteUndirectedIntGraph()
Deprecated. 
Create a new ConcreteUndirectedIntGraph with default weight for unconnected vertices and default capacity.

See Also:
setUnconnectedWeight(double), ConcreteUndirectedIntGraph(double, int)

ConcreteUndirectedIntGraph

public ConcreteUndirectedIntGraph(int initialCapacity)
Deprecated. 
Create a new ConcreteUndirectedIntGraph with default weight for unconnected vertices.

Parameters:
initialCapacity - The initial capacity of vertices (grows automatically) or a negative value to use a default value.
See Also:
setUnconnectedWeight(double), ConcreteUndirectedIntGraph(double, int)

ConcreteUndirectedIntGraph

public ConcreteUndirectedIntGraph(double unconnectedWeight,
                                  int initialCapacity)
Deprecated. 
Create a new ConcreteUndirectedIntGraph.

Parameters:
unconnectedWeight - The weight for unconnected vertices. Default is UndirectedGraph#DEFAULT_UNCONNECTED_WEIGHT.
initialCapacity - The initial capacity of vertices (grows automatically) or a negative value to use a default value.
Method Detail

getUnconnectedWeight

public double getUnconnectedWeight()
Deprecated. 
Description copied from interface: UndirectedIntGraph
The method UndirectedIntGraph.getEdgeWeight(int, int) returns a double value for any possible edge connecting two vertices in the graph. If an edge does not exist, the method will return this value.

Specified by:
getUnconnectedWeight in interface UndirectedIntGraph
Returns:
A weight for not existing edges.

setUnconnectedWeight

public void setUnconnectedWeight(double unconnectedWeight)
Deprecated. 
Description copied from interface: UndirectedMutableIntGraph
Change the weight that is returned by UndirectedIntGraph.getEdgeWeight(int, int) if the two vertices are not connected. This will remove all edges that currently have unconnectedWeight as their weight.

Specified by:
setUnconnectedWeight in interface UndirectedMutableIntGraph
Parameters:
unconnectedWeight - The new weight for unconnected vertices.

numVertices

public int numVertices()
Deprecated. 
Description copied from interface: UndirectedIntGraph
Get the number of vertices.

Specified by:
numVertices in interface UndirectedIntGraph
Returns:
The number of vertices in the graph.

numEdges

public int numEdges()
Deprecated. 
Description copied from interface: UndirectedIntGraph
Get the number of edges.

Specified by:
numEdges in interface UndirectedIntGraph
Returns:
The number of edges in the graph.

numEdges

public int numEdges(int vertex)
Deprecated. 
Specified by:
numEdges in interface UndirectedIntGraph
Parameters:
vertex - Which vertex to count edges of.
Returns:
The number of edges this vertex is connected with.

vertices

public int[] vertices()
Deprecated. 
Description copied from interface: UndirectedIntGraph
Get an array containing all current vertices of this graph.

Specified by:
vertices in interface UndirectedIntGraph
Returns:
The array.
See Also:
UndirectedIntGraph.numVertices()

verticesConnectedTo

public int[] verticesConnectedTo(int vertex)
Deprecated. 
Description copied from interface: UndirectedIntGraph
Get an array containing all vertices that are connected with given vertex at the moment of this call.

Specified by:
verticesConnectedTo in interface UndirectedIntGraph
Parameters:
vertex - The vertex.
Returns:
The array.
See Also:
UndirectedIntGraph.numEdges(int)

edges

public java.util.Iterator<? extends UndirectedMutableIntGraph.Edge> edges()
Deprecated. 
Description copied from interface: UndirectedIntGraph
Get an iterator over all edges of the graph. Each edge is only visited once.

Specified by:
edges in interface UndirectedIntGraph
Specified by:
edges in interface UndirectedMutableIntGraph
Returns:
The iterator.
See Also:
UndirectedIntGraph.numEdges()

edgesConnectedTo

public java.util.Iterator<? extends UndirectedMutableIntGraph.Edge> edgesConnectedTo(int vertex)
Deprecated. 
Description copied from interface: UndirectedIntGraph
Get an iterator over all edges in the graph, given vertex is connected with.

Specified by:
edgesConnectedTo in interface UndirectedIntGraph
Specified by:
edgesConnectedTo in interface UndirectedMutableIntGraph
Parameters:
vertex - The vertex.
Returns:
The iterator.
See Also:
UndirectedIntGraph.numEdges(int)

containsVertex

public boolean containsVertex(int vertex)
Deprecated. 
Description copied from interface: UndirectedIntGraph
Check if given vertex is contained in the graph.

Specified by:
containsVertex in interface UndirectedIntGraph
Parameters:
vertex - The vertex to look for.
Returns:
True if the vertex is contained. False otherwise.

containsEdge

public boolean containsEdge(int vertexA,
                            int vertexB)
Deprecated. 
Description copied from interface: UndirectedIntGraph
Check if there exists an edge in the graph connecting the two vertices given as parameters.

Specified by:
containsEdge in interface UndirectedIntGraph
Parameters:
vertexA - One vertex.
vertexB - The other vertex.
Returns:
True if both vertices are connected.

getEdgeWeight

public double getEdgeWeight(int vertexA,
                            int vertexB)
Deprecated. 
Description copied from interface: UndirectedIntGraph
Get the weight of the edge connecting the two vertices. This will return UndirectedIntGraph.getUnconnectedWeight() if the two vertices are not connected.

Specified by:
getEdgeWeight in interface UndirectedIntGraph
Parameters:
vertexA - One vertex.
vertexB - The other vertex.
Returns:
The weight of the edge or UndirectedIntGraph.getUnconnectedWeight().
See Also:
UndirectedIntGraph.containsEdge(int, int), UndirectedIntGraph.getEdge(int, int)

getEdge

public UndirectedMutableIntGraph.Edge getEdge(int vertexA,
                                              int vertexB)
Deprecated. 
Description copied from interface: UndirectedIntGraph
Get the UndirectedIntGraph.Edge connecting the two vertices. The object will also be returned if there does not exists such an edge in the graph. Use UndirectedIntGraph.Edge.exists() to check.

Specified by:
getEdge in interface UndirectedIntGraph
Specified by:
getEdge in interface UndirectedMutableIntGraph
Parameters:
vertexA - One vertex.
vertexB - The other vertex.
Returns:
The edge.
See Also:
UndirectedIntGraph.containsEdge(int, int), UndirectedIntGraph.getEdgeWeight(int, int)

addVertex

public boolean addVertex(int vertex)
Deprecated. 
Description copied from interface: UndirectedMutableIntGraph
Add a vertex to the graph.

Specified by:
addVertex in interface UndirectedMutableIntGraph
Parameters:
vertex - The vertex to be added.
Returns:
True if the graph changed during this call. False if the graph already contained that vertex.

removeVertex

public boolean removeVertex(int vertex)
Deprecated. 
Description copied from interface: UndirectedMutableIntGraph
Remove a vertex from the graph.

Specified by:
removeVertex in interface UndirectedMutableIntGraph
Parameters:
vertex - The vertex to be removed.
Returns:
True if the graph changed during this call. False if the graph has not contained that vertex.

setEdgeWeight

public double setEdgeWeight(int vertexA,
                            int vertexB,
                            double weight)
Deprecated. 
Description copied from interface: UndirectedMutableIntGraph
Set the weight of a edge determined by two vertices. If the new weight is UndirectedIntGraph.getUnconnectedWeight(), this should be the same as calling UndirectedMutableIntGraph.removeEdge(int, int). The old weight of the edge is returned, which may be UndirectedIntGraph.getUnconnectedWeight() if the edge had not existed.

Specified by:
setEdgeWeight in interface UndirectedMutableIntGraph
Parameters:
vertexA - One vertex of the edge.
vertexB - The other vertex of the edge.
weight - The new weight of the edge.
Returns:
The value that would have been returned by a call to UndirectedIntGraph.getEdgeWeight(int, int) directly before this call.

removeEdge

public double removeEdge(int vertexA,
                         int vertexB)
Deprecated. 
Description copied from interface: UndirectedMutableIntGraph
Remove a edge determined by two vertices. The old weight of the edge is returned, which may be UndirectedIntGraph.getUnconnectedWeight() if the edge had not existed (in which case nothing has happened).

Specified by:
removeEdge in interface UndirectedMutableIntGraph
Parameters:
vertexA - One vertex of the edge.
vertexB - The other vertex of the edge.
Returns:
The value that would have been returned by a call to UndirectedIntGraph.getEdgeWeight(int, int) directly before this call.