graphdual.h

Go to the documentation of this file.
00001 /* this file define structure to make graph duals */
00002 #ifndef __GRAPHDUAL_H__
00003 #define __GRAPHDUAL_H__
00004 #include <stdlib.h>
00005 #include <stdio.h>
00006 #include <math.h>
00007 #include "cookInterface.h"
00008 #include "eg_mempool.h"
00009 #include "eg_list.h"
00010 #include "eg_dgraph.h"
00011 #include "eg_ugraph.h"
00012 #include "eg_equiset.h"
00013 #include "eg_bit.h"
00014 #include "eg_dijkstra.h"
00015 #include "eg_menger.h"
00016 #include "eg_menger_app.h"
00017 #include "bc_spanning.h"
00018 #include "eg_util.h"
00019 #include "dp_config.h"
00020 #include "graph_boyer.h"
00021 
00022 #define GD_LEVEL 9
00023 
00024 /* check planarity of a graph in cook's format */
00025 int isPlanarBoyer (int nnodes,
00026                    int nedges,
00027                    int *edges);
00028 /* check planarity of a graph in cook's format, return minor if not */
00029 int isPlanarOrMinorBoyer (int nnodes,
00030                           int nedges,
00031                           int *edges,
00032                           int *nmedges,
00033                           int *medges);
00034 
00035 /* generate the dual graph */
00036 EGdGraph_t *getDualBoyer (graphP G,
00037                           int nnodes,
00038                           int nedges,
00039                           double *weigh,
00040                           EGlist_t *** dembed,
00041                           EGmemPool_t * localmem,
00042                           EGlist_t***lembed);
00043 
00044 /* this function chooses an edge among the k lightest edges (by weight) of a
00045    kuratowski minor. If no such minor exists, values -1 are set for the ends. */
00046 
00047 int DPfindBadEdge (int nnodes,
00048                    int nedges,
00049                    int *edges,
00050                    double *weight);
00051 
00052 /* this function chooses an edge among the k lightest edges (by weight) of a
00053    kuratowski minor. If no such minor exists, values -1 are set for the ends. */
00054 
00055 int DPfindBadEdgeK (int nnodes,
00056                     int nedges,
00057                     int *edges,
00058                     double *weight,
00059                     int k);
00060 
00061 /* generate a planar subgraph from a graph by building a maximum weight spanning
00062  * tree and then eliminating edges that make it non planar */
00063 int DPedgeEliminationHeuristic (int nnodes,
00064                                 int nedges,
00065                                 int *edges,
00066                                 double *weight,
00067                                 int *nplanar_edges,
00068                                 int *planar_edges,
00069                                 double *planar_weight,
00070                                 int *nelim_indices,
00071                                 int *elim_indices);
00072 
00073 /* This function works with two graphs G1 and G2 spanning a common set of
00074    vertices. It assumes that G2 is a planar graph, and that its edge set 
00075    is strictly contained in that of G1. It finds a graph G3 in between
00076    G1 and G2 that is planar by means of binary search and edge additions.
00077   
00078    nnodes: number of nodes in G1 and G2.
00079    nedges1: number of edges of G1.
00080    nedges2: number of edges of G2.
00081    edges: array of edges in G1. It is assumed that the first nedges2 edges
00082           of the array are the edges of G2. In Cook format.
00083    nedges3: number of edges in G3 (output).
00084    edges3: array with edges in G3 in Cook format (output).
00085    elim_indices: array with the indices of those edges eliminated from edges. */
00086 int DPbinPlanarizeBoyer (int nnodes,
00087                          int nedges1,
00088                          int nedges2,
00089                          int *edges,
00090                          double *weigh,
00091                          int *nedges3,
00092                          int *edges3,
00093                          double *weigh3,
00094                          int *elim_indices);
00095 
00096 /* This function finds a minor in the graph described by
00097  * nnodes and nedges and then identifies two nodes,
00098  * node_1 and node_2, which upon contraction ensure that
00099  * the graph no longer has the minor. If there is no such
00100  * minor, then the values of node_1 and node_2 are set to
00101  * -1. If there is no such
00102  * minor, then the values of node_1 and node_2 are set to
00103  * -1.*/
00104 
00105 int DPgetMinorNodesToContract (int nnodes,
00106                                int nedges,
00107                                int *edges,
00108                                int *node_1,
00109                                int *node_2);
00110 
00111 /* same as above, but preserves the minor */
00112 
00113 int DPgetNonMinorNodesToContract (int nnodes,
00114                                   int nedges,
00115                                   int *edges,
00116                                   double *weight,
00117                                   int *node_1,
00118                                   int *node_2);
00119 
00120 int DPgetTrivialNodesToContract (int nnodes,
00121                                  int nedges,
00122                                  int *edges,
00123                                  double *weight,
00124                                  int *node_1,
00125                                  int *node_2);
00126 
00127 /* This function works with a graph G1. It finds a graph G2 contained in G1
00128    which is planar by eliminating edges in Kuratowski minors.
00129   
00130    nnodes: number of nodes in G1.
00131    nedges1: number of edges of G1.
00132    edges: array of edges in G1. (Cook format).
00133    nedges3: number of edges in G3 (output).
00134    edges3: array with edges in G3 in Cook format (output).
00135    elim_indices: array with the indices of those edges eliminated from edges. */
00136 
00137 int DPfastEdgeEliminationHeuristic (int nnodes,
00138                                     int nedges1,
00139                                     int *edges,
00140                                     double *weight,
00141                                     int *nedges2,
00142                                     int *edges2,
00143                                     double *weight2,
00144                                     int *nelim,
00145                                     int *elim_indices,
00146                                     int k_param);
00147 
00148 int DPfindBadBinEdge (int nnodes,
00149                       int nedges,
00150                       int *edges);
00151 
00152 int DPfindBadBinEdgeK (int nnodes,
00153                        int nedges,
00154                        int *edges,
00155                        double *weight,
00156                        int k);
00157 
00158 int DPgetBinMinor (int nnodes,
00159                    int nedges,
00160                    int *edges,
00161                    int *nmedges,
00162                    int *medges,
00163                    int k);
00164 #endif

Generated on Thu Oct 20 14:58:41 2005 for DominoParitySeparator by  doxygen 1.4.5