#
# This is the api of a bipartite graph
#
# -- Allen Leung
# Compiled by:
#
src/lib/graph/graphs.lib### "Money can't buy you happiness, but
### it can buy you a yacht big enough
### to pull up right alongside it."
###
### -- David Lee Roth
api Bipartite_Graph {
include api Oop_Digraph; # Oop_Digraph is from
src/lib/graph/oop-digraph.api Bigraph (M,N,E,G) = BIGRAPH Bigraph_Methods (M,N,E,G)
withtype Bigraph_Methods (M,N,E,G) =
{ name: String,
graph_info: G,
# Inserting/removing nodes and edges
new_src: M -> Node( M ),
new_dst: N -> Node( N ),
add_src: Node( M ) -> Void,
add_dst: Node( N ) -> Void,
add_edge: Edge( E ) -> Void,
remove_src: Node_Id -> Void,
remove_dst: Node_Id -> Void,
remove_edge: Edge( E ) -> Void,
# Collect deleted node ids
garbage_collect: Void -> Void,
# selectors
src_nodes: Void -> List( Node( M ) ),
dst_nodes: Void -> List( Node( N ) ),
edges: Void -> List( Edge( E ) ),
src_order: Void -> Int,
dst_order: Void -> Int,
size: Void -> Int,
capacity: Void -> Int,
next: Node_Id -> List( Node_Id ),
prior: Node_Id -> List( Node_Id ),
out_edges: Node_Id -> List( Edge( E ) ),
in_edges: Node_Id -> List( Edge( E ) ),
has_edge: (Node_Id, Node_Id) -> Bool,
has_src: Node_Id -> Bool,
has_dst: Node_Id -> Bool,
src_node: Node_Id -> M,
dst_node: Node_Id -> N,
# iterators
forall_src: (Node( M ) -> Void) -> Void,
forall_dst: (Node( N ) -> Void) -> Void,
forall_edges: (Edge( E ) -> Void) -> Void
};
};