Skip to content

Commit

Permalink
Even more whitespace cleanups, while I'm in here...
Browse files Browse the repository at this point in the history
  • Loading branch information
rick committed Jan 3, 2016
1 parent 6c7fff4 commit dcf10aa
Show file tree
Hide file tree
Showing 17 changed files with 116 additions and 132 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -13,7 +13,7 @@ $ script/setup # will clean and build all the relevant sources, run this before
The `script/run-graphs` ruby script will generate one of four types of data, with the specified number of nodes, run the CSA-Q solver over that data, and deposit a matching file in the designated location:

```
$ script/run-graphs
$ script/run-graphs
RuntimeError: usage: script/run-graphs [high|low|fixed|dense] <nodecount> <output file>
$ time script/run-graphs high 100000 /tmp/flow.txt
Expand Down Expand Up @@ -42,7 +42,7 @@ real 0m1.534s
user 0m1.404s
sys 0m0.127s
$ wc -l /tmp/flow.txt
$ wc -l /tmp/flow.txt
50000 /tmp/flow.txt
```

Expand Down
4 changes: 2 additions & 2 deletions csa/COPYRIGHT
Expand Up @@ -2,8 +2,8 @@ COPYRIGHT C 1994 by Andrew Goldberg and Robert Kennedy.
Permission to use free of charge is granted provided
that proper acknowledgments are given.

This software comes with NO WARRANTY, expressed or implied. By way
This software comes with NO WARRANTY, expressed or implied. By way
of example, but not limitation, we make no representations of warranties
of merchantability or fitness for any particular purpose or that the use
of the software components or documentation will not infringe any patents,
copyrights, trademarks, or other rights.
copyrights, trademarks, or other rights.
2 changes: 1 addition & 1 deletion csa/parse.c
Expand Up @@ -12,7 +12,7 @@
#define BADCOUNT 1006 /* Arc count discrepancy */
#define NONCONTIG 1007 /* Node id numbers not contiguous */
#define NOMEM 1008 /* Not enough memory */

char *err_messages[] =
{
"Can't read from the input file.",
Expand Down
1 change: 0 additions & 1 deletion csa/prec_costs/Makefile
Expand Up @@ -183,4 +183,3 @@ csa_s_spo_pr_pu: $(BASEFILES) $(HEADERS) p_refine.c p_update.c check_po_arcs.c l

csa_q_spo_pr_pu: $(BASEFILES) $(HEADERS) p_refine.c p_update.c check_po_arcs.c queue.c list.c
cc $(CFLAGS) -DUSE_PRICE_OUT -DSTRONG_PO -DUSE_P_UPDATE -DUSE_P_REFINE -DQUEUE_ORDER -o $@ $(BASEFILES) p_refine.c p_update.c check_po_arcs.c queue.c list.c -lm

2 changes: 1 addition & 1 deletion csa/prec_costs/update_epsilon.c
Expand Up @@ -4,7 +4,7 @@
#include "csa_types.h"
#include "csa_defs.h"

/*
/*
extern double epsilon, min_epsilon, scale_factor;
*/
extern double epsilon, min_epsilon;
Expand Down
14 changes: 7 additions & 7 deletions csa/round_costs/p_update.c
Expand Up @@ -20,9 +20,9 @@ reachability in the admissible graph for all excesses.
*/

unsigned u_scan(w)

rhs_ptr w;

{
register rl_aptr b, b_stop;
register lr_aptr a;
Expand All @@ -32,7 +32,7 @@ register long wk, uk;
register long p;
long u_to_w_cost;
unsigned excess_found = 0;

u_scans++;
b_stop = (w+1)->priced_out;
p = w->p;
Expand Down Expand Up @@ -89,21 +89,21 @@ return(excess_found);
}

void p_update()

{
rhs_ptr w;
lhs_ptr v;
long delta_c, this_cost;
long balance, level;
lr_aptr a, a_stop;

p_update_time -= myclock();
p_updates++;

#ifdef DEBUG
(void) printf("Doing p_update(): total_e = %lu\n", total_e);
#endif

for (v = head_lhs_node; v != tail_lhs_node; v++)
{
a_stop = (v+1)->priced_out;
Expand Down
2 changes: 1 addition & 1 deletion csa/stack.c
Expand Up @@ -28,7 +28,7 @@ unsigned size;
{
stack s;
void exit();

s = (stack) malloc(sizeof(struct stack_st));

if (s == NULL)
Expand Down
25 changes: 11 additions & 14 deletions dimacs/asnmin.a
@@ -1,38 +1,35 @@
#This program converts a file in .asn format to one in .min
#This program converts a file in .asn format to one in .min
#format by the following method:
# --source nodes have supply 1
# --sink nodes have demand -1
# --arcs lower bounds are 0, arc capacities 1
# --arc costs are copied over
# --arc costs are copied over

BEGIN {firstarc = 1;
print "c Transformation of asn to min format" }
BEGIN {firstarc = 1;
print "c Transformation of asn to min format" }

#make first line or flag error
#make first line or flag error
# (NR == 1) && ($1 == "asn") { nodes = $2; arcs = $3;
(NR == 1) && ($1 == "p") && ($2 == "asn") { nodes = $3; arcs = $4;
print "p", "min" , nodes, arcs
print "p", "min" , nodes, arcs
}
# (NR == 1) && ($1 != "asn") { print "ERROR WRONG INPUT FORMAT"}
(NR == 1) && (($1 != "p") || ($2 != "asn")) { print "ERROR WRONG INPUT FORMAT"}

#copy over comments
#copy over comments
$1 == "c" {print $0}

#make sources and remember which they are
$1 == "n" { print "n", "\t", $2, "\t", 1 ;
remember[$2] = 1;
$1 == "n" { print "n", "\t", $2, "\t", 1 ;
remember[$2] = 1;
}

#make destination nodes
(($1 == "a") && (firstarc==1)) { firstarc = 0;
(($1 == "a") && (firstarc==1)) { firstarc = 0;
for (i = 1; i<= nodes; i++) {
if (remember[i] != 1) print "n", "\t", i, "\t", -1 ;
if (remember[i] != 1) print "n", "\t", i, "\t", -1 ;
}
}

#make arcs
$1 == "a" {print "a", "\t", $2, "\t", $3, "\t", 0, "\t", 1, "\t", $4}



25 changes: 10 additions & 15 deletions dimacs/benchmarks/readme
@@ -1,33 +1,28 @@

The ftp directory pub/netflow/benchmarks contains two subdirectories
for benchmark tests of your local computing environment.
The ftp directory pub/netflow/benchmarks contains two subdirectories
for benchmark tests of your local computing environment.

fortran/ Contains programs and inputs for a test of a Fortran program.
In that directory, see either readme.unix or readme.notunix
depending upon whether your system can support Unix tools
fortran/ Contains programs and inputs for a test of a Fortran program.
In that directory, see either readme.unix or readme.notunix
depending upon whether your system can support Unix tools
such as pipes, awk, and shell programs.

c/ Contains programs and inputs for a test of a C program.
c/ Contains programs and inputs for a test of a C program.
In that directory, see either readme.unix or readme.notunix
depending upon whether your system can support Unix tools.
depending upon whether your system can support Unix tools.

If you can, run both the Fortran and C tests on your local system. The
If you can, run both the Fortran and C tests on your local system. The
goal is to gather timing information for a wide variety of architectures.

Given the variety of architectures that participants are using, it is
difficult to anticipate what will be possible and interesting. Send a
note to netflow@dimacs.rutgers.edu if one of the following occurs:

1) Some input files are too large to be transferred to your system.
2) Some input files are too small to give interesting runtimes.
3) Some other problem prevents you from performing the tests.
2) Some input files are too small to give interesting runtimes.
3) Some other problem prevents you from performing the tests.

Enjoy!
Cathy McGeoch
Challenge Coordiinator
mcgeoch@dimacs.rutgers.edu





17 changes: 6 additions & 11 deletions dimacs/generators.readme
@@ -1,20 +1,15 @@
This directory contains programs that generate networks and graphs.
Most are in the DIMACS format.
Most are in the DIMACS format.

This Directory Contains:

universal.c : A very portable random number generator, as C-language
function calls. Read the in-line code.
function calls. Read the in-line code.

matching/ : A directory of generators for matching problems.

matching/ : A directory of generators for matching problems.

net-simple/ : A directory containing some very simple-minded generators,
for checking compatiblity with DIMACS format. These
generators are not much good for testing code.

network/ : A directory containing generators for network problems.




generators are not much good for testing code.

network/ : A directory containing generators for network problems.
26 changes: 13 additions & 13 deletions dimacs/geomasn.a
@@ -1,34 +1,34 @@
#This awk program converts files in the DIMACS .geom format into
#bipartite instances in the .asn format. The first N/2 vertices
#are red, and the last N/2 are blue (assumes n is even).
#are red, and the last N/2 are blue (assumes n is even).
#The program generates all red-to-blue edges, with edge costs corresponding
#to Euclidean distance (using only the first two dimensions), truncated
#to an integer.
#to an integer.

# C. McGeoch, July 1991

$1 == "p" { nodes = $3;
count = 0;
count = 0;
reds = nodes/2;
print "p" , "asn", nodes, reds*reds;
print "c Converted from geometric instance "
print "c using geomasn.a "
print "c using geomasn.a "

for (i = 1; i<= reds; i++) { print "n", i }
for (i = 1; i<= reds; i++) { print "n", i }
}

$1 == "v" {count++;
if (count <= reds) { # save the red location
if (count <= reds) { # save the red location
rx[count] = $2;
ry[count] = $3;
ry[count] = $3;
}
else { #generate red-blue arcs
bx = $2; by = $3;
for (i=1; i<=reds; i++)
else { #generate red-blue arcs
bx = $2; by = $3;
for (i=1; i<=reds; i++)
{ d1 = rx[i] - bx;
d2 = ry[i] - by;
dist = sqrt( d1*d1 + d2*d2 );
d2 = ry[i] - by;
dist = sqrt( d1*d1 + d2*d2 );
printf "a %d %d %d\n", i, count, dist ;
}
}
}
}
35 changes: 17 additions & 18 deletions dimacs/matching.readme
Expand Up @@ -4,34 +4,34 @@ This directory contains instance generators for matching problems.
asnmat.a : Awk program to convert DIMACS .asn format to
.edge format.

clusters.c : Generates points within a circle which are clustered
clusters.c : Generates points within a circle which are clustered
according to some input parameters. Documentation is
in code. To compile: cc clusters.c -lm
in code. To compile: cc clusters.c -lm

dcube.c : Generates points uniform within a d-dimensional cube.
Documentation is in the code.
dcube.c : Generates points uniform within a d-dimensional cube.
Documentation is in the code.

hardcard.f : Generates (nongeometric) graphs which Gabow has shown
hardcard.f : Generates (nongeometric) graphs which Gabow has shown
will be hard for Edmond's cardinality matching algorithm.
Provided by R. B. Mattingly. This is a Fortran program.
Provided by R. B. Mattingly. This is a Fortran program.
To compile: f77 hardcard.f

neighbor.c : Takes a graph in .geom format and a command line argument
k. Produces a graph in .edge format. Vertex i is has an
edge to vertices [i-k, i-1]. See the code for more
documentation.
NOTE: a version which includes the p line and which is
slightly more robust was installed July 26.
edge to vertices [i-k, i-1]. See the code for more
documentation.
NOTE: a version which includes the p line and which is
slightly more robust was installed July 26.

random.c : Generates a random undirected graph with m edges. Edge
weights are uniformly distributed within a specified range.
See the code for further documentation.
NOTE: the original version contains a bug. The fixed
version was installed July 22.
See the code for further documentation.
NOTE: the original version contains a bug. The fixed
version was installed July 22.

t.f : Generates a sequence of K one-connected triangles
in .edge format.
Written in Fortran. These graphs tend to generate
t.f : Generates a sequence of K one-connected triangles
in .edge format.
Written in Fortran. These graphs tend to generate
a lot of blossoms.
Contributed by N. Ritchey and B. Mattingly

Expand All @@ -42,4 +42,3 @@ tt.f : Generates a sequence of K tri-connected triangles

fractals/ : Subdirectory containing generators of fractal-like instances,
in .geom format.

28 changes: 14 additions & 14 deletions dimacs/net-simple.readme
@@ -1,25 +1,25 @@
This directory contains very simple generators for network problems.
Also contains translators from .asn and .max files to .min files.
This directory contains very simple generators for network problems.
Also contains translators from .asn and .max files to .min files.
THESE GENERATORS PRODUCED INSTANCES WHICH ARE SYNTACTICALLY CORRECT
(FOR DIMACS CHALLENGE FORMAT) BUT WHICH ARE PRETTY MUCH UNINTERESTING
OTHERWISE.
(FOR DIMACS CHALLENGE FORMAT) BUT WHICH ARE PRETTY MUCH UNINTERESTING
OTHERWISE.

genasn.c Generate an instance for assignment. See comments in
program for command format. C source.
genasn.c Generate an instance for assignment. See comments in
program for command format. C source.

genmin.c Generate an instance for min-cost flow. See comments in
code for instructions. C source.
genmin.c Generate an instance for min-cost flow. See comments in
code for instructions. C source.

genmax.c Generate an instance for max flow. See comments in
code for instructions. C source.
genmax.c Generate an instance for max flow. See comments in
code for instructions. C source.

makefile The make file.
makefile The make file.

test.* Sample input files. The suffix .min .max .asn denotes
inputs for min-cost flow, max flow, and assignment.
inputs for min-cost flow, max flow, and assignment.

asnmin.a An awk program to convert assignment instances, in
.asn format, to min-cost flow instances in .min format.
.asn format, to min-cost flow instances in .min format.

maxmin.a An awk program toconver max-flow instances, in .max format,
to min-cost flow instances in .min format.
to min-cost flow instances in .min format.

0 comments on commit dcf10aa

Please sign in to comment.