giden.GRDS
Class Graph

java.lang.Object
  |
  +--giden.GRDS.Graph
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
Network

public class Graph
extends java.lang.Object
implements java.io.Serializable

Copyright (c) 1993-2004 C. R. Coullard, D. S. Dilworth, J. H. Owen, All Rights Reserved.
We make no representations or warranties about the suitability of the software, either express or implied, including but not limited to the implied warranties of merchantability, fitness for a particular purpose, or non-infringement. We shall not be liable for any damages suffered by user as a result of using, modifying or distributing this software or its derivatives.

Graph is class for managing (creating, accessing, and deleting) Nodes and Ndges. A Graph object contains a LinkList of its Nodes, a LinkList of its Edges, and a LinkList of incident edges, for each Node, accessible via the Node object. Nodes and Edges are created using methods provided by this class, and those methods automatically update the related Graph data structures. The Node and Edge lists are accessed through NodeListIters and EdgeListIters (iterators) provided by the Graph object. The number of created Nodes or Edges or the current number of Nodes or Edges are also available.

Copyright (c) 1993-2003 C. R. Coullard, D. S. Dilworth, J. H. Owen, All Rights Reserved.

Version:
4.0a 2004 08 27
Author:
D. S. Dilworth
See Also:
Edge, EdgeListIter, GraphState, InListIter, LinkList, Network, Node, NodeListIter, OutListIter, Serialized Form

Field Summary
 giden.CORE.UiNetwork UiNet
           
 
Constructor Summary
Graph()
          Creates an empty graph (a graph with no Nodes and no Edges)
 
Method Summary
 Edge CreateEdge(Node source, Node target)
          Creates an Edge joining two Nodes
 Node CreateNode()
          Creates a Node in this graph
 void DeleteAllEdges()
          Internal method
 void DeleteAllNodes()
          Internal method
 void DeleteEdge(Edge edge)
          Deletes the edge from this graph
 void DeleteGraph()
          Internal method
 void DeleteNode(Node node)
          Deletes the given Node and all its incident Edges from this graph
 int GetCreatedEdgesCount()
          Gets the total number of edges ever created.
 int GetCreatedNodesCount()
          Gets the total number of Nodes ever created by this Graph.
 boolean GetDirected()
          Returns true if the graph is directed, false otherwise
 int GetEdgeCount()
          Gets the current number of Edges in this Graph.
 int GetEdgeIndex()
          Internal method
 EdgeListIter GetEdgeListIter()
          Gets the iterator for this graph's edge list
 int GetNodeCount()
          Gets the current number of Nodes in this Graph.
 int GetNodeIndex()
          Internal method
 NodeListIter GetNodeListIter()
          Gets the iterator for this Graph's Node list
 giden.CORE.SolverServices GetSolverServices()
          Returns the solver services object for creating new windows
 void IncrementEdgeIndex()
          Internal method
 void IncrementNodeIndex()
          Internal method
 void PutDirected(boolean directed)
          Changes the graph's directed flag, true means it's directed
 void PutSolverServices(giden.CORE.SolverServices services)
          internal method
 Edge ReverseEdge(Edge edge)
          Internal method
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UiNet

public giden.CORE.UiNetwork UiNet
Constructor Detail

Graph

public Graph()
Creates an empty graph (a graph with no Nodes and no Edges)
Method Detail

PutSolverServices

public void PutSolverServices(giden.CORE.SolverServices services)
internal method

GetSolverServices

public giden.CORE.SolverServices GetSolverServices()
Returns the solver services object for creating new windows

DeleteGraph

public void DeleteGraph()
Internal method

GetDirected

public boolean GetDirected()
Returns true if the graph is directed, false otherwise

PutDirected

public void PutDirected(boolean directed)
Changes the graph's directed flag, true means it's directed

GetNodeCount

public int GetNodeCount()
Gets the current number of Nodes in this Graph. This number is incremented with each successful CreateNode call and is decremented with each successful DeleteNode call.
Returns:
The current number of Nodes in this Graph.
See Also:
GetCreatedNodesCount()

GetCreatedNodesCount

public int GetCreatedNodesCount()
Gets the total number of Nodes ever created by this Graph. This number is incremented with each successful CreateNode call and is never decremented. Useful for setting the size of node arrays.
Returns:
The total number of Nodes ever created by this Graph
See Also:
GetEdgeCount()

GetNodeIndex

public int GetNodeIndex()
Internal method

CreateNode

public Node CreateNode()
Creates a Node in this graph
Returns:
The new node

IncrementNodeIndex

public void IncrementNodeIndex()
Internal method

GetNodeListIter

public NodeListIter GetNodeListIter()
Gets the iterator for this Graph's Node list
Returns:
A NodeListIter for this Graph object

DeleteNode

public void DeleteNode(Node node)
Deletes the given Node and all its incident Edges from this graph

DeleteAllNodes

public void DeleteAllNodes()
Internal method

GetEdgeCount

public int GetEdgeCount()
Gets the current number of Edges in this Graph. This number is incremented with each successful CreateEdge call and is decremented with each successful DeleteEdge call.
Returns:
The current of the number of Edges in this Graph.
See Also:
GetCreatedEdgesCount()

GetCreatedEdgesCount

public int GetCreatedEdgesCount()
Gets the total number of edges ever created. This number is incremented with each successful CreateEdge call and is never decremented. Useful for setting the size of Edge arrays.
Returns:
The number of Edges created by this Graph
See Also:
GetEdgeCount()

GetEdgeIndex

public int GetEdgeIndex()
Internal method

CreateEdge

public Edge CreateEdge(Node source,
                       Node target)
Creates an Edge joining two Nodes
Returns:
A new Edge.

IncrementEdgeIndex

public void IncrementEdgeIndex()
Internal method

ReverseEdge

public Edge ReverseEdge(Edge edge)
Internal method

GetEdgeListIter

public EdgeListIter GetEdgeListIter()
Gets the iterator for this graph's edge list
Returns:
an EdgeListIter for this graph

DeleteEdge

public void DeleteEdge(Edge edge)
Deletes the edge from this graph

DeleteAllEdges

public void DeleteAllEdges()
Internal method