[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] Retrieving the conflict graph of a MIP using glpk-4.52

From: Andrew Makhorin
Subject: Re: [Help-glpk] Retrieving the conflict graph of a MIP using glpk-4.52
Date: Fri, 18 Oct 2013 06:37:56 +0400

> I am interested in generating the conflict graphs of a set of
> instances to analyze some of the properties of such graphs. I am aware
> that with the latest release (4.52) there is a new implementation of
> the COG generator that allows the processing of large and dense COG. I
> would like to know if there is the possibility of easily extracting
> such graph in a simple way. 

This feature is not available on api level. However, you may use
corresponding internal glpk routines as follows:

#include "glpk.h"
#include "cfg.h"

glp_prob *P;
int *ind, v;
. . .
/* create problem object P */
. . .
/* construct the conflict graph */
G = cfg_build_graph(P);
. . .
/* retrieve the conflict graph */
ind = calloc(1+G->nv, sizeof(int));
for (v = 1; v <= G->nv, v++)
{   /* retrieve the list of vertices adjacent to vertex v */
    len = cfg_get_adjacent(G, v, ind);
    . . .
. . .

For description of the cfg routines see comments in files cfg.h and
cfg.c in subdirectory glpk/src/cglib/.

On compiling you need to specify -I option for all glpk source
directories (src, src/cglib, etc.) and use a static version of the glpk
library (because internal routines are not exported). Please note that
in general case the conflict graph may be very large and dense (so its
edges are not stored explicitly in the CFG object).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]