06.08.2013 Views

A subgradient-based branch-and-bound algorithm for the ...

A subgradient-based branch-and-bound algorithm for the ...

A subgradient-based branch-and-bound algorithm for the ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

D Test problem generator<br />

In <strong>the</strong> following, we reproduce <strong>the</strong> C-code used <strong>for</strong> generating <strong>the</strong> test problem<br />

instances.<br />

/*----------------------------------------------------------------*/<br />

/* FILE : gencflp .c */<br />

/* VERSION : 1.0 */<br />

/* DATE : July 13 , 2000 */<br />

/* AUTHOR : Andreas Klose */<br />

/* SUBJECT : program to generate CFLP test problems */<br />

/*----------------------------------------------------------------*/<br />

/* USAGE : gencflp */<br />

/* */<br />

/* where " inputfile " is an ascii file providing <strong>the</strong> following */<br />

/* in<strong>for</strong>mation on how to generate <strong>the</strong> test instances : */<br />

/* (1) Seed , that is an integer number specifying <strong>the</strong> seed to be */<br />

*/ used <strong>for</strong> <strong>the</strong> r<strong>and</strong>om number generator (if Seed =0 <strong>the</strong>n a seed */<br />

/* is generated automatically ) */<br />

/* (2) <strong>for</strong> every problem class : */<br />

/* # customers # depot sites ratio problem name */<br />

/* where ratio is <strong>the</strong> desired ratio of total capacity to total */<br />

/* total dem<strong>and</strong> . */<br />

/* The second argument "path ‘‘ is an optional <strong>and</strong> should specify */<br />

/* <strong>the</strong> output path */<br />

/*----------------------------------------------------------------*/<br />

# include <br />

# include <br />

# include <br />

# include <br />

# include <br />

long unifR<strong>and</strong> ( long m);<br />

/* returns uni<strong>for</strong>m integer r<strong>and</strong>om number in [0 ,m). See file rnd .c */<br />

double UR<strong>and</strong> ();<br />

/* returns uni<strong>for</strong>m real r<strong>and</strong>om number in [0 ,1). See file rnd .c */<br />

/*----------------------------------------------------------------*/<br />

int m,n,num ; /* number of customers , depots , instances */<br />

int *f, *d, *s; /* fixed depot costs , dem<strong>and</strong>s <strong>and</strong> capacities */<br />

int *x, *y; /* coordinates */<br />

int totd , totc ; /* total dem<strong>and</strong> <strong>and</strong> total capacity */<br />

char name [512]; /* problem name */<br />

char fname [512]; /* name of file where to store problem data */<br />

double r; /* r = totc / totd */<br />

time_t tt;<br />

/*----------------------------------------------------------------*/<br />

void gencusts ( void ) {<br />

/* Generate customers with dem<strong>and</strong> 5 + u [0 ,30] */<br />

int i;<br />

totd = 0;<br />

<strong>for</strong> (i =0;i

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!