|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--shared.Graph
An instance G of the data type graph consists of a list V of nodes and a list E of edges (node and edge are item types). Distinct graphs have disjoint node and edge lists. The value of a variable of type node is either the node of some graph, or the special value nil (which is distinct from all nodes), or is undefined (before the first assignment to the variable). A corresponding statement is true for the variables of type edge.
A graph with empty node list is called empty. A pair of nodes (v,w) is associated with every edge; v is called the source of e and w is called the target of e, and v and w are called endpoints of e. The edge e is said to be incident to its endpoints.
A graph is either directed or undirected. The difference between directed and undirected graphs is the way the edges incident to a node are stored and how the concept adjacent is defined.
In directed graphs two lists of edges are associated with every node v: adj_edges(v) = e v = source(e), i.e., the list of edges starting in v, and in_edges(v) = e Lvert v = target(e), i.e., the list of edges ending in v. The list adj_edges(v) is called the adjacency list of node v and the edges in adj_edges(v) are called the edges adjacent to node v. For directed graphs we often use out_edges(v) as a synonym for adj_edges(v).
In undirected graphs only the list adj_edges(v) is defined for every every node v. Here it contains all edges incident to v, i.e., adj_edges(v) = e v source(e),target(e). An undirectect graph may not contain selfloops, i.e., it may not contain an edge whose source is equal to its target.
In a directed graph an edge is adjacent to its source and in an undirected graph it is adjacent to its source and target. In a directed graph a node w is adjacent to a node v if there is an edge (v,w) E; in an undirected graph w is adjacent to v if there is an edge (v,w) or (w,v) in the graph.
A directed graph can be made undirected and vice versa: G.make_undirected() makes the directed graph G undirected by appending for each node v the list in_edges(v) to the list adj_edges(v) (removing selfloops). Conversely, G.make_directed() makes the undirected graph G directed by splitting for each node v the list adj_edges(v) into the lists out_edges(v) and in_edges(v). Note that these two operations are not exactly inverse to each other. The data type ugraph (cf. section ref{Undirected Graphs) can only represent undirected graphs.
Reversal Information, Maps and Faces The reversal information of an edge e is accessed through G.reversal(e), it has type edge and may or may not be defined (=nil). Assume that G.reversal(e) is defined and let e' = G.reversal(e). Then e = (v,w) and e' = (w,v) for some nodes v and w, G.reversal(e') is defined and e = G.reversal(e'). In other words, reversal deserves its name.
We call a directed graph bidirected if for every edge of G the reversed edge also belongs to G and we call a bidirected graph a map if all edges have their reversal information defined. Maps are the data structure of choice for embedded graphs. For an edge e of a map G let face_cycle_succ(e) = cyclic_adj_succ(reversal(e)) and consider the sequence e, face_cycle_succ(e), face_cycle_succ(face_cycle_succ(e)),. The first edge to repeat in this sequence is e (why?) and the set of edges appearing in this sequence is called the face cycle containing e. Each edge is contained in some face cycle and face cycles are pairwise disjoint. Let f be the number of face cycles, n be the number of nodes, m be the number of edges, and let c be the number of connected components. Then g = (m/2 - n - f)/2 + c is called the genus of the map (note that m/2 is the number of edges in the underlying undirected graph). The genus is zero if and only if the map is planar, i.e., there is an embedding of G into the plane such that for every node v the counter-clockwise ordering of the edges around v agrees with the cyclic ordering of v's adjacency list.
If a graph G is a map the faces of G can be constructed explicitely by G.compute_faces(). Afterwards, the faces of G can be traversed by different iterators, e.g., forall_faces(f,G) iterates over all faces , forall_adj_faces(v) iterates over all faces adjacent to node v. By using face maps or arrays (data types face_map and face_array) additional information can be associated with the faces of a graph. Note that any update operation performed on G invalidates the list of faces. See the section on face operations for a complete list of available operations for faces.
| Inner Class Summary | |
protected class |
Graph.EdgeSorter
Sorter class for edges. |
protected class |
Graph.MapEdgeOrd1
Map edge ordering class. |
protected class |
Graph.MapEdgeOrd2
Map edge ordering class. |
protected class |
Graph.NodeSorter
Sorter class for nodes. |
protected class |
Graph.Orderer
Ordering class for this graph. |
| Field Summary | |
protected SortFunction |
edge_comparer
Comparison function for comparing edges. |
protected GraphMap |
edge_data_map
Graph map of edges. |
protected Graph.MapEdgeOrd1 |
map_edge_ord1
Map edge ordering instance. |
protected Graph.MapEdgeOrd2 |
map_edge_ord2
Map edge ordering instance. |
protected SortFunction |
node_comparer
Comparison function for comparing nodes. |
protected GraphMap |
node_data_map
Graph map of nodes. |
protected OrderingFunction |
order_alg
Ordering function for sorts. |
protected Graph |
parent
The parent graph of this graph. |
int |
space
Unused data member. |
protected java.util.LinkedList |
v_list
List of nodes in this graph. |
| Fields inherited from interface shared.ParamTypes |
CHAR_TYPE_ID,
DOUBLE_TYPE_ID,
FLOAT_TYPE_ID,
INT_TYPE_ID,
LONG_TYPE_ID,
PTR_TYPE_ID,
SHORT_TYPE_ID,
UNKNOWN_TYPE_ID |
| Constructor Summary | |
Graph()
Constructor. |
|
Graph(Graph a)
Copy constructor. |
|
Graph(Graph G,
java.util.LinkedList el)
SubGraph constructor. |
|
Graph(Graph a,
java.util.LinkedList nl,
java.util.LinkedList el)
SubGraph constructor. |
|
Graph(int sz1,
int sz2)
Constructor. |
|
| Method Summary | |
protected Face |
access_face(Edge e)
Returns the face containing e. |
java.util.LinkedList |
adj_edges(Node v)
Returns the adjacent edges of the given node. |
java.util.LinkedList |
adj_nodes(Node v)
Returns the nodes reached through all adjacent edges. |
Edge |
adj_pred(Edge e,
Node v)
Returns the previous adjacent edge. |
Edge |
adj_succ(Edge e,
Node v)
Returns the next adjacent edge. |
java.util.LinkedList |
all_edges()
Returns a list of all edges in this graph. |
java.util.LinkedList |
all_faces()
Returns a list of all faces in this graph. |
java.util.LinkedList |
all_nodes()
Returns a list of all nodes in this graph. |
protected void |
assign(Edge e,
java.lang.Object x)
Assigns the given data to the graph object. |
protected void |
assign(Face f,
java.lang.Object x)
Assigns the given data to the graph object. |
void |
assign(Graph G)
Copies the given graph into this graph. |
protected void |
assign(Node v,
java.lang.Object x)
Assigns the given data to the graph object. |
void |
bucket_sort_edges(GraphMap A)
Sorts the edge list in the given map. |
void |
bucket_sort_edges(int l,
int h,
OrderingFunction ord)
Sorts the edge list between the given indecies. |
void |
bucket_sort_edges(OrderingFunction ord)
Sorts the edge list. |
void |
bucket_sort_nodes(GraphMap A)
Sorts the node list in the given map. |
void |
bucket_sort_nodes(int l,
int h,
OrderingFunction ord)
Sorts the node list between the given indecies. |
void |
bucket_sort_nodes(OrderingFunction ord)
Sorts the node list. |
void |
bucket_sort(java.util.LinkedList the_list,
int i,
int j,
OrderingFunction ord_reference)
Sorts the given list. |
void |
bucket_sort(java.util.LinkedList the_list,
OrderingFunction ord)
Sorts the given list. |
Edge |
choose_edge()
Choose random edge. |
Face |
choose_face()
Randomly returns a face. |
Node |
choose_node()
Choose a random node. |
protected void |
clear_all_entries()
Clears all entries, does nothing. |
void |
clear()
Clears this graph of edges, nodes, and faces. |
void |
comment(java.lang.String S)
Sets comment string; does nothing. |
protected void |
copy_all_entries()
Copies all entries; does nothing. |
void |
copy_graph(Graph G)
Copies the given graph. |
Edge |
cyclic_adj_pred(Edge e,
Node v)
Returns the previous adjacent edge. |
Edge |
cyclic_adj_succ(Edge e,
Node v)
Returns the next adjacent edge. |
void |
del_adj_edge(Edge e,
Node v,
Node w)
Deletes the given edge between the given nodes. |
void |
del_all_edges()
Deletes all edges in graph. |
void |
del_all_faces()
Deletes all faces of graph. |
void |
del_all_nodes()
Deletes all nodes in graph. |
void |
del_edge(Edge e)
Edge to be deleted. |
void |
del_edges(java.util.LinkedList L)
Deletes the edges in the given list. |
void |
del_node(Node v)
Delete the given node. |
void |
del_nodes(java.util.LinkedList L)
Deletes the nodes in the given list. |
java.lang.String |
edge_type()
Returns "void". |
java.util.ListIterator |
edgeIterator()
Returns a listiterator of edges in this graph. |
boolean |
empty()
Returns true if there are no nodes in this graph, false otherwise. |
java.lang.Object |
entry(Edge e)
Returns the data stored in this graph object. |
java.lang.Object |
entry(Face f)
Returns the data stored in this graph object. |
java.lang.Object |
entry(Node v)
Returns the data stored in this graph object. |
Face |
face_of(Edge e)
Returns the face containing e. |
java.lang.String |
face_type()
Returns "void". |
Edge |
first_edge()
Returns the first edge in the edge list. |
Edge |
first_face_edge(Face f)
Returns the first edge in the graph face. |
Face |
first_face()
Returns the first face in the face list. |
Node |
first_node()
Returns the first node in the graph's node list. |
void |
hide_edge(Edge e)
Makes the given edge hidden. |
java.lang.Object |
inf(Edge e)
Returns the data stored in this graph object. |
java.lang.Object |
inf(Face f)
Returns the data stored in this graph object. |
java.lang.Object |
inf(Node v)
Returns the data stored in this graph object. |
void |
ins_adj_edge(Edge e,
Node v,
Edge e1,
Node w,
Edge e2,
int d1,
int d2)
Adds edge e between the given nodes. |
java.util.LinkedList |
insert_reverse_edges()
Creates a list of reversed edges. |
boolean |
is_directed()
Returns true if this graph is directed, false otherwise. |
boolean |
is_hidden(Edge e)
Returns true if the given edge is hidden, false otherwise. |
boolean |
is_undirected()
Returns true if this graph is undirected, false otherwise. |
void |
join(Graph G)
Joins the given graph with this graph. |
Edge |
last_edge()
Returns the last edge in the edge list. |
Face |
last_face()
Returns the last face in the face list. |
Node |
last_node()
Returns the last node in the graph's node list. |
void |
make_directed()
Converts this graph to a directed graph. |
boolean |
make_map()
Returns true if every edge has a reverse edge, false otherwise. |
void |
make_map(java.util.LinkedList R)
Adds reverse edges of all edges in graph to the given list. |
void |
make_undirected()
Converts this graph to an undirected graph. |
Node |
merge_nodes(Node v1,
Node v2)
Merges the given nodes. |
void |
move_edge(Edge e,
Edge e1,
Edge e2,
int d1,
int d2)
Moves edge e. |
void |
move_edge(Edge e,
Edge e1,
Node w,
int dir)
Moves edge e. |
void |
move_edge(Edge e,
Node v,
Node w)
Moves edge e. |
Edge |
new_edge(Edge e1,
Edge e2)
Creates a new edge between the source and target nodes of the given edges. |
Edge |
new_edge(Edge e1,
Edge e2,
int d1)
Creates a new edge between the source and target nodes of the given edges. |
Edge |
new_edge(Edge e1,
Edge e2,
int d1,
int d2)
Creates a new edge between the source and target nodes of the given edges. |
Edge |
new_edge(Edge e1,
Edge e2,
java.lang.Object i,
int dir1,
int dir2)
Creates a new edge |
Edge |
new_edge(Edge e,
Node w)
Creates a new edge between the source of the given edge and the given target node. |
Edge |
new_edge(Edge e,
Node w,
int dir)
Creates a new edge between the source of the given edge and the given target node. |
Edge |
new_edge(Edge e,
Node w,
java.lang.Object i,
int dir)
Creates a new edge between the source of the given edge and the given target node. |
Edge |
new_edge(Node v,
Edge e)
Creates a new edge between the given source node and the target of the given edge. |
Edge |
new_edge(Node v,
Edge e,
int dir)
Creates a new edge between the given source node and the target of the given edge. |
Edge |
new_edge(Node v,
Edge e,
Node w)
Creates a new edge between the given nodes. |
Edge |
new_edge(Node v,
Edge e1,
Node w,
Edge e2)
Creates a new edge between the given nodes. |
Edge |
new_edge(Node v,
Edge e1,
Node w,
Edge e2,
int d1)
Creates a new edge between the given nodes. |
Edge |
new_edge(Node v,
Edge e1,
Node w,
Edge e2,
int d1,
int d2)
Creates a new edge between the given nodes. |
Edge |
new_edge(Node v,
Edge e1,
Node w,
Edge e2,
java.lang.Object i,
int d1,
int d2)
Creates a new edge to the given nodes. |
Edge |
new_edge(Node v,
Edge e,
Node w,
int d)
Creates a new edge between the given nodes. |
Edge |
new_edge(Node v,
Edge e,
Node w,
java.lang.Object i,
int dir)
Creates a new edge between the given nodes. |
Edge |
new_edge(Node v,
Edge e,
java.lang.Object i,
int dir)
Creates a new edge between the target of the given edge and the given source node. |
Edge |
new_edge(Node v,
Node w)
Creates a new edge between the given nodes. |
Edge |
new_edge(Node v,
Node w,
Edge e)
Creates a new edge between the given nodes. |
Edge |
new_edge(Node v,
Node w,
Edge e,
int d)
Creates a new edge between the given nodes. |
Edge |
new_edge(Node v,
Node w,
Edge e,
java.lang.Object i,
int dir)
Creates a new edge between the given nodes. |
Edge |
new_edge(Node v,
Node w,
java.lang.Object i)
Creates a new edge between the given nodes and containing the given information. |
java.lang.Object |
new_node()
Creates a new node. |
protected Node |
new_node(java.lang.Object i)
Creates a new node. |
Edge |
next_face_edge(Edge e,
Face F)
Returns the next edge in the face. |
java.lang.String |
node_type()
Returns "void". |
java.util.ListIterator |
nodeIterator()
Returns a listiterator of the list of nodes in this graph. |
int |
number_of_edges()
Returns the number of edges. |
int |
number_of_faces()
Returns the number of faces. |
int |
number_of_nodes()
Returns the number of nodes. |
protected void |
post_clear_handler()
Function called after entries are cleared. |
protected void |
post_del_edge_handler(Node A,
Node B)
Function called after edge is deleted. |
protected void |
post_del_node_handler()
Function called after node deleted. |
protected void |
post_hide_edge_handler(Edge E)
Function called after edge is hidden. |
protected void |
post_move_edge_handler(Edge E,
Node A,
Node B)
Function called after edge is moved. |
protected void |
post_new_edge_handler(Edge E)
Function called after new edge is created. |
protected void |
post_new_node_handler(Node A)
Function called after inserting a node. |
protected void |
post_restore_edge_handler(Edge E)
Function called after edge is restored. |
protected void |
pre_clear_handler()
Function called before entries are cleared. |
protected void |
pre_del_edge_handler(Edge E)
Function called when edge is deleted. |
protected void |
pre_del_node_handler(Node A)
Function called before deleting a node. |
protected void |
pre_hide_edge_handler(Edge E)
Function called before edge is hidden. |
protected void |
pre_move_edge_handler(Edge E,
Node A,
Node B)
Function called before edge is moved. |
protected void |
pre_new_edge_handler(Node A,
Node B)
Function called before a new edge is created. |
protected void |
pre_new_node_handler()
Function called before inserting a node. |
protected void |
pre_restore_edge_handler(Edge E)
Function called before edge is restored. |
Edge |
pred_edge(Edge e)
Returns the previous edge in the edge list. |
Face |
pred_face(Face f)
Returns the previous face in the face list. |
Node |
pred_node(Node v)
Returns the previous node in the node list. |
void |
print(java.lang.String s,
java.io.Writer out)
Prints graph to the supplied writer. |
void |
print(java.io.Writer out)
Prints graph to the supplied writer. |
boolean |
query()
Returns true. |
boolean |
query(Edge E)
Returns true. |
boolean |
query(Node N,
Node M)
Returns true. |
int |
register_map(GraphMap M)
Registers the given GraphMap. |
void |
restore_all_edges()
Restore all edges. |
void |
restore_edge(Edge e)
Restores edge from being hidden. |
void |
rev_all_edges()
Reverses the direction on all edges. |
Edge |
rev_edge(Edge e)
Reverses the direction of the given edge. |
Graph |
rev()
Reverses all edges. |
Edge |
reversal(Edge e)
Returns the reversed edge. |
Edge |
reverse(Edge e)
Returns the reversed edge. |
void |
set_edge_entry(Edge e,
java.lang.String s)
Sets the edge entry, does nothing. |
void |
set_node_entry(Node v,
java.lang.String s)
Sets the node entry, does nothing. |
int |
size(Face f)
Returns the size of the given face. |
protected void |
sort_edges()
Sorts edges. |
void |
sort_edges(GraphMap A)
Sort edges in the given graph map; does nothing. |
void |
sort_edges(java.util.LinkedList el)
Sort edges in the given list. |
void |
sort_edges(SortFunction sorter)
Sorts edges using the given sort function. |
protected void |
sort_nodes()
Sorts nodes. |
void |
sort_nodes(GraphMap A)
Sort nodes in the given graph map; does nothing. |
void |
sort_nodes(java.util.LinkedList vl)
Sort nodes in the given list. |
void |
sort_nodes(SortFunction sorter)
Sorts nodes using the given sort function. |
Node |
split_edge(Edge e,
Edge e1,
Edge e2)
Splits edge e into e1 and e2. |
protected Node |
split_edge(Edge e,
java.lang.Object node_inf,
Edge e1,
Edge e2)
Splits edge e into edges e1 and e2. |
Edge |
succ_edge(Edge e)
Returns the next edge in the edge list. |
Face |
succ_face(Face f)
Returns the next face in the face list. |
Node |
succ_node(Node v)
Returns the next node in the node list. |
void |
touch(Edge E,
java.lang.String S)
Does nothing. |
void |
touch(Node N,
java.lang.String S)
Does nothing. |
void |
unregister_map(GraphMap M)
Unregisters the given GraphMap. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
protected java.util.LinkedList v_list
protected Graph parent
protected GraphMap node_data_map
protected GraphMap edge_data_map
public int space
protected SortFunction edge_comparer
protected SortFunction node_comparer
protected OrderingFunction order_alg
protected Graph.MapEdgeOrd1 map_edge_ord1
protected Graph.MapEdgeOrd2 map_edge_ord2
| Constructor Detail |
public Graph()
public Graph(int sz1,
int sz2)
sz1 - Number of nodes.sz2 - Number of Edges.
public Graph(Graph a,
java.util.LinkedList nl,
java.util.LinkedList el)
a - Parent graph.nl - List of nodes for this graph.el - List of edges for this graph.
public Graph(Graph G,
java.util.LinkedList el)
G - Parent graph.el - List of Edges for this graph.public Graph(Graph a)
a - Graph to be copied.| Method Detail |
public java.util.ListIterator nodeIterator()
public java.util.ListIterator edgeIterator()
public Edge new_edge(Node v,
Edge e1,
Node w,
Edge e2,
java.lang.Object i,
int d1,
int d2)
v - The source node.e1 - Edge connecting to the source node.w - The target node.e2 - Edge connecting to the target node.i - The data to be stored in the edge.d1 - Method of connecting to e1. The new edge is connected after(if d1=0)/before(if d1=1) e1.d2 - Method of connecting to e2. The new edge is connected after(if d2=0)/before(if d2=1) e2.
public Edge new_edge(Node v,
Node w,
java.lang.Object i)
v - The source node for the new edge.w - The target node for the new edge.i - The data to be stored in the edge.
public Edge new_edge(Edge e,
Node w,
java.lang.Object i,
int dir)
e - The edge connected to the source node.w - The target node.i - The data stored in the new edge.dir - Method of connecting to e. The new edge is connected after(if dir=0)/before(if dir=1) e.
public Edge new_edge(Node v,
Edge e,
java.lang.Object i,
int dir)
v - The source node.e - The edge connected to the target node.i - The data stored in the new edge.dir - Method of connecting to e. The new edge is connected after(if dir=0)/before(if dir=1) e.
public Edge new_edge(Edge e1,
Edge e2,
java.lang.Object i,
int dir1,
int dir2)
e1 - Edge connecting to source node.e2 - Edge connecting to target node.i - The data stored in the new edge.dir1 - Method of connecting to e1. The new edge is connected after(if dir1=0)/before(if dir1=1) e1.dir2 - Method of connecting to e2. The new edge is connected after(if dir2=0)/before(if dir2=1) e2.
public Edge new_edge(Node v,
Edge e,
Node w,
java.lang.Object i,
int dir)
v - The source node.e - Edge connected to the source node.w - The target node.i - The data stored in the new edge.dir - Method of connecting to e. The new edge is connected after(if dir=0)/before(if dir=1) e.
public Edge new_edge(Node v,
Node w,
Edge e,
java.lang.Object i,
int dir)
v - The source node.w - The target node.e - Edge connected to the target node.i - The data stored in the new edge.dir - Method of connecting to e. The new edge is connected after(if dir=0)/before(if dir=1) e.
public Edge new_edge(Node v,
Node w)
v - The source node.w - The target node.
public Edge new_edge(Edge e,
Node w)
e - Edge connected to the source node.w - The target node.
public Edge new_edge(Edge e,
Node w,
int dir)
e - Edge connected to the source node.w - The target node.dir - Method of connecting to e. The new edge is connected after(if dir=0)/before(if dir=1) e.
public Edge new_edge(Node v,
Edge e)
v - The source node.e - Edge connected to the target node.
public Edge new_edge(Node v,
Edge e,
int dir)
v - The source node.e - Edge connected to the target node.dir - Method of connecting to e. The new edge is connected after(if dir=0)/before(if dir=1) e.
public Edge new_edge(Edge e1,
Edge e2,
int d1,
int d2)
e1 - Edge connected to the source node.e2 - Edge connected to the target node.d1 - Method of connecting to e1. The new edge is connected after(if d1=0)/before(if d1=1) e1.d2 - Method of connecting to e2. The new edge is connected after(if d2=0)/before(if d2=1) e2.
public Edge new_edge(Edge e1,
Edge e2,
int d1)
e1 - Edge connected to the source node.e2 - Edge connected to the target node.d1 - Method of connecting to e1. The new edge is connected after(if d1=0)/before(if d1=1) e1.
public Edge new_edge(Edge e1,
Edge e2)
e1 - Edge connected to the source node.e2 - Edge connected to the target node.
public Edge new_edge(Node v,
Edge e1,
Node w,
Edge e2,
int d1,
int d2)
v - The source node.e1 - Edge connected to the source node.w - The target node.e2 - Edge connected to the target node.d1 - Method of connecting to e1. The new edge is connected after(if d1=0)/before(if d1=1) e1.d2 - Method of connecting to e2. The new edge is connected after(if d2=0)/before(if d2=1) e2.
public Edge new_edge(Node v,
Edge e1,
Node w,
Edge e2,
int d1)
v - The source node.e1 - Edge connected to the source node.w - The target node.e2 - Edge connected to the target node.d1 - Method of connecting to e1. The new edge is connected after(if d1=0)/before(if d1=1) e1.
public Edge new_edge(Node v,
Edge e1,
Node w,
Edge e2)
v - The source node.e1 - Edge connected to the source node.w - The target node.e2 - Edge connected to the target node.
public Edge new_edge(Node v,
Edge e,
Node w,
int d)
v - The source node.e - Edge connected to the source node.w - The target node.d - Method of connecting to e. The new edge is connected after(if d=0)/before(if d=1) e.
public Edge new_edge(Node v,
Edge e,
Node w)
v - The source node.e - Edge connected to the source node.w - The target node.
public Edge new_edge(Node v,
Node w,
Edge e,
int d)
v - The source node.w - The target node.e - Edge connected to the target node.d - Method of connecting to e. The new edge is connected after(if d=0)/before(if d=1) e.
public Edge new_edge(Node v,
Node w,
Edge e)
v - The source node.w - The target node.e - Edge connected to the target node.
public void ins_adj_edge(Edge e,
Node v,
Edge e1,
Node w,
Edge e2,
int d1,
int d2)
e - Edge to be added.v - Source node for the edge.e1 - Edge connected to the source node.w - Target node for the edge.e2 - Edge connected to the target node.d1 - Method of connecting to e1. The new edge is connected after(if d1=0)/before(if d1=1) e1.d2 - Method of connecting to e2. The new edge is connected after(if d2=0)/before(if d2=1) e2.
public void del_adj_edge(Edge e,
Node v,
Node w)
e - The edge to be deleted.v - The source node for the edge.w - The target node for the edge.public int register_map(GraphMap M)
M - Graphmap to be registered.public void unregister_map(GraphMap M)
M - Graphmap to be unregistered.public Node first_node()
public Node last_node()
public Node succ_node(Node v)
v - The node whose successor is requested.public Node pred_node(Node v)
v - The node whose predecessor is requested.public Edge first_edge()
public Edge last_edge()
public Edge succ_edge(Edge e)
e - The edge whose successor is requested.public Edge pred_edge(Edge e)
e - The edge whose predecessor is requested.protected void copy_all_entries()
protected void clear_all_entries()
public java.lang.String node_type()
public java.lang.String edge_type()
public java.lang.String face_type()
public void copy_graph(Graph G)
G - The graph to be copied.public java.lang.Object new_node()
protected Node new_node(java.lang.Object i)
i - Data to be stored in this node.public void assign(Graph G)
G - The graph to be copied.
public void set_node_entry(Node v,
java.lang.String s)
v - The node to be set.s - The new setting.
public void set_edge_entry(Edge e,
java.lang.String s)
e - The edge to be set.s - The new setting.protected void pre_new_node_handler()
protected void post_new_node_handler(Node A)
A - The node added.protected void pre_del_node_handler(Node A)
A - Node deleted.protected void post_del_node_handler()
protected void pre_new_edge_handler(Node A,
Node B)
A - Source node.B - Target node.protected void post_new_edge_handler(Edge E)
E - The new edge.protected void pre_del_edge_handler(Edge E)
E - The edge deleted.
protected void post_del_edge_handler(Node A,
Node B)
A - Source node of edge.B - Target node of edge.
protected void pre_move_edge_handler(Edge E,
Node A,
Node B)
E - Edge moved.A - Edge's source node.B - Edge's target node.
protected void post_move_edge_handler(Edge E,
Node A,
Node B)
E - The edge moved.A - The edge's source node.B - The edge's target node.protected void pre_hide_edge_handler(Edge E)
E - Edge to hide.protected void post_hide_edge_handler(Edge E)
E - Edge hidden.protected void pre_restore_edge_handler(Edge E)
E - Edge to be restored.protected void post_restore_edge_handler(Edge E)
E - Edge restored.protected void pre_clear_handler()
protected void post_clear_handler()
public int number_of_nodes()
public int number_of_edges()
public java.util.LinkedList all_nodes()
public java.util.LinkedList all_edges()
public java.util.LinkedList all_faces()
public Node choose_node()
public Edge choose_edge()
public boolean is_directed()
public boolean is_undirected()
public boolean empty()
public java.lang.Object entry(Node v)
v - The object whose information is requested.public java.lang.Object entry(Edge e)
e - The object whose information is requested.public java.lang.Object entry(Face f)
f - The object whose information is requested.public java.lang.Object inf(Node v)
v - The object whose information is requested.public java.lang.Object inf(Edge e)
e - The object whose information is requested.public java.lang.Object inf(Face f)
f - The object whose information is requested.
protected Node split_edge(Edge e,
java.lang.Object node_inf,
Edge e1,
Edge e2)
e - Edge to be split.node_inf - Node data for target node.e1 - First edge si is split into.e2 - Second edge e is split into.
protected void assign(Node v,
java.lang.Object x)
v - The node to store the data.x - The data stored.
protected void assign(Edge e,
java.lang.Object x)
e - The edge to store the data.x - The data stored.
protected void assign(Face f,
java.lang.Object x)
f - The face to store the data.x - The data stored.protected Face access_face(Edge e)
e - Edge for which face is requested.
public Node merge_nodes(Node v1,
Node v2)
v1 - First node merged.v2 - Second node merged.
public Node split_edge(Edge e,
Edge e1,
Edge e2)
e - Edge to be split.e1 - First edge split from e.e2 - Second edge split from e.public void hide_edge(Edge e)
e - Edge to hide.public boolean is_hidden(Edge e)
e - The edge to be checked.public void restore_edge(Edge e)
e - Edge to be restored.public void restore_all_edges()
public void del_node(Node v)
v - The node to be deleted.public void del_edge(Edge e)
e - Edge to be deleted.public void del_nodes(java.util.LinkedList L)
L - List of nodes to be deleted.public void del_edges(java.util.LinkedList L)
L - List of edges to be deleted.public void del_all_nodes()
public void del_all_edges()
public void del_all_faces()
public void move_edge(Edge e,
Edge e1,
Edge e2,
int d1,
int d2)
e - Edge to be moved.e1 - Edge connected to the source node.e2 - Edge connected to the target node.d1 - Method of connecting to e1. The new edge is connected after(if d1=0)/before(if d1=1) e1.d2 - Method of connecting to e2. The new edge is connected after(if d2=0)/before(if d2=1) e2.
public void move_edge(Edge e,
Edge e1,
Node w,
int dir)
e - Edge to be moved.e1 - Edge connected to the source node.w - New target node.dir - Method of connecting to e1. The new edge is connected after(if dir=0)/before(if dir=1) e1.
public void move_edge(Edge e,
Node v,
Node w)
e - Edge to be moved.v - New source node.w - New target node.public Edge rev_edge(Edge e)
e - The edge whose direction is reversed.public void rev_all_edges()
public Graph rev()
public java.util.LinkedList insert_reverse_edges()
public void make_undirected()
public void make_directed()
public void clear()
public void join(Graph G)
G - Graph to be joined.public Edge reversal(Edge e)
e - The edge for which reversed is requested.public Edge reverse(Edge e)
e - The edge for which reversed is requested.public Face face_of(Edge e)
e - Edge for which face is requested.public int number_of_faces()
public Face first_face()
public Face last_face()
public Face succ_face(Face f)
f - The face whose successor is requested.public Face pred_face(Face f)
f - The face whose predecessor is requested.public Face choose_face()
public java.util.LinkedList adj_nodes(Node v)
v - The node for which adjacent nodes are requested.public java.util.LinkedList adj_edges(Node v)
v - The node for which adjacent edges are requested.public int size(Face f)
f - The face for which size is requested.public Edge first_face_edge(Face f)
f - Face for which a first edge is requested.
public Edge next_face_edge(Edge e,
Face F)
e - The edge for which a successor is requested.F - The face for which the next edge is requested.
public Edge adj_succ(Edge e,
Node v)
e - Edge for which successor is requested.v - The node connected to these adjacent edges.
public Edge adj_pred(Edge e,
Node v)
e - Edge for which predecessor edge is requested.v - The node connected to these adjacent edges.
public Edge cyclic_adj_succ(Edge e,
Node v)
e - Edge for which successor is requested.v - The node connected to these adjacent edges.
public Edge cyclic_adj_pred(Edge e,
Node v)
e - Edge for which predecessor edge is requested.v - The node connected to these adjacent edges.public boolean make_map()
public void make_map(java.util.LinkedList R)
R - List of reverse edges.public void sort_nodes(GraphMap A)
A - Graph map of nodes.public void sort_edges(GraphMap A)
A - Graph map of edges.public void sort_nodes(java.util.LinkedList vl)
vl - List of nodes.public void sort_edges(java.util.LinkedList el)
el - List of edges.public void sort_nodes(SortFunction sorter)
sorter - Sort function.public void sort_edges(SortFunction sorter)
sorter - Sort function.protected void sort_nodes()
protected void sort_edges()
public void bucket_sort(java.util.LinkedList the_list,
int i,
int j,
OrderingFunction ord_reference)
the_list - The list to be sorted.i - The index of the first value to be sorted.j - The index of the last value to be sorted.ord_reference - Ordering function.
public void bucket_sort(java.util.LinkedList the_list,
OrderingFunction ord)
the_list - The list to be sorted.ord - Ordering function.
public void bucket_sort_nodes(int l,
int h,
OrderingFunction ord)
l - The index of the first value to be sorted.h - The index of the last value to be sorted.ord - Ordering function.
public void bucket_sort_edges(int l,
int h,
OrderingFunction ord)
l - The index of the first value to be sorted.h - The index of the last value to be sorted.ord - Ordering function.public void bucket_sort_nodes(OrderingFunction ord)
ord - Ordering function.public void bucket_sort_edges(OrderingFunction ord)
ord - Ordering function.public void bucket_sort_nodes(GraphMap A)
A - The graph map to be sorted.public void bucket_sort_edges(GraphMap A)
A - The graph map to be sorted.
public void touch(Node N,
java.lang.String S)
N - The node to be examined.S - The string used for comment.
public void touch(Edge E,
java.lang.String S)
E - The edge to be examined.S - The string used for comment.public void comment(java.lang.String S)
S - The string used for comment.public boolean query()
public boolean query(Node N,
Node M)
N - Source node queried.M - Target node queried.public boolean query(Edge E)
E - Edge queried.
public void print(java.lang.String s,
java.io.Writer out)
s - Header string.out - The writer to which display is written.public void print(java.io.Writer out)
out - The writer to which display is written.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||