home *** CD-ROM | disk | FTP | other *** search
- /*******************************************************************************
- +
- + LEDA 2.1.1 11-15-1991
- +
- +
- + graph_alg.h
- +
- +
- + Copyright (c) 1991 by Max-Planck-Institut fuer Informatik
- + Im Stadtwald, 6600 Saarbruecken, FRG
- + All rights reserved.
- +
- *******************************************************************************/
-
-
- #ifndef GRAPHALGH
- #define GRAPHALGH
-
- #include <LEDA/graph.h>
- #include <LEDA/ugraph.h>
-
-
- //-----------------------------------------------------------------------------
- // Predefined:
- //-----------------------------------------------------------------------------
-
- declare(node_array,int)
- declare(edge_array,int)
- declare(node_array,edge)
- declare(edge_array,edge)
-
- declare(node_matrix,int)
-
- typedef node_array(int) node_array(bool);
- typedef edge_array(int) edge_array(bool);
- typedef node_matrix(int) node_matrix(bool);
-
-
-
- //-----------------------------------------------------------------------------
- // basic graph algorithms:
- //-----------------------------------------------------------------------------
-
- bool compute_correspondence(const graph&, edge_array(edge)&);
-
- bool TOPSORT(const graph& G, node_array(int)& ord);
-
- bool TOPSORT1(graph& G);
-
- list(node) DFS(const graph& G, node s, node_array(bool)& reached) ;
-
- list(node) BFS(const graph& G, node s, node_array(int)& dist);
-
- list(edge) DFS_NUM(const graph& G, node_array(int)& dfsnum,
- node_array(int)& compnum);
-
- int COMPONENTS(const ugraph& G, node_array(int)& compnum);
-
- int COMPONENTS1(const ugraph& G, node_array(int)& compnum);
-
- int STRONG_COMPONENTS(const graph& G, node_array(int)& compnum);
-
- int STRONG_COMPONENTS1(const graph& G, node_array(int)& compnum);
-
- int BICONNECTED_COMPONENTS(const ugraph& G, node_array(int)& compnum);
-
- void acyclic_transitive_closure(graph&);
-
- graph TRANSITIVE_CLOSURE(const graph& G);
-
-
-
- //-----------------------------------------------------------------------------
- // shortest paths:
- //-----------------------------------------------------------------------------
-
- void DIJKSTRA(const graph& G, node s, const edge_array(int)& cost,
- node_array(int)& dist,
- node_array(edge)& pred);
-
- bool BELLMAN_FORD(const graph& G, node s, const edge_array(int)& cost,
- node_array(int)& dist,
- node_array(edge)& pred);
-
- void ALL_PAIRS_SHORTEST_PATHS(graph& G, const edge_array(int)& cost,
- node_matrix(int)& dist);
-
-
-
-
- //-----------------------------------------------------------------------------
- // maximum flow:
- //-----------------------------------------------------------------------------
-
-
- int MAX_FLOW(graph& G, node s, node t, const edge_array(int)& cap,
- edge_array(int)& flow);
-
-
- //-----------------------------------------------------------------------------
- // matchings:
- //-----------------------------------------------------------------------------
-
- // Edmond's algorithm
-
- list(edge) MAX_CARD_MATCHING(graph& G, bool report_blossoms = false);
-
-
- // Hopcroft/Karp
-
- list(edge) MAX_CARD_BIPARTITE_MATCHING(graph& G, const list(node)& A,
- const list(node)& B);
-
-
-
- list(edge) MAX_WEIGHT_BIPARTITE_MATCHING(graph& G, const list(node)& A,
- const list(node)& B,
- const edge_array(int)& weight);
-
-
-
-
- //-----------------------------------------------------------------------------
- // spanning trees:
- //-----------------------------------------------------------------------------
-
- list(edge) SPANNING_TREE(const graph& G);
-
- list(edge) MIN_SPANNING_TREE(const graph& G, const edge_array(int)& cost);
-
-
-
- //-----------------------------------------------------------------------------
- // planar graphs
- //-----------------------------------------------------------------------------
-
- int PLANAR( graph&) ;
-
- list(edge) TRIANGULATE_PLANAR_MAP(graph&);
-
- int STRAIGHT_LINE_EMBEDDING(graph& G,node_array(int)& xcoord,
- node_array(int)& ycoord);
-
-
-
- //-----------------------------------------------------------------------------
- // "REAL" versions
- //-----------------------------------------------------------------------------
-
-
- #ifndef NO_REAL_GRAPH_ALG
-
-
- declare(node_array,real)
- declare(edge_array,real)
- declare(node_matrix,real)
-
- void DIJKSTRA(const graph& G, node s, const edge_array(real)& cost,
- node_array(real)& dist,
- node_array(edge)& pred);
-
- bool BELLMAN_FORD(const graph& G, node s, const edge_array(real)& cost,
- node_array(real)& dist,
- node_array(edge)& pred);
-
-
- void ALL_PAIRS_SHORTEST_PATHS(graph& G, const edge_array(real)& cost,
- node_matrix(real)& dist);
-
-
- real MAX_FLOW(graph& G, node s, node t, const edge_array(real)& cap,
- edge_array(real)& flow);
-
-
- list(edge) MAX_WEIGHT_BIPARTITE_MATCHING(graph& G, const list(node)& A,
- const list(node)& B,
- const edge_array(real)& weight);
-
-
- int STRAIGHT_LINE_EMBEDDING(graph& G,node_array(real)& xcoord,
- node_array(real)& ycoord);
-
-
- list(edge) MIN_SPANNING_TREE(const graph& G, const edge_array(real)& cost);
-
-
- #endif /* ifndef NO_REAL_GRAPH_ALG */
-
-
- #endif
-