Scripts for experiments with min-cost sat
- LIB_0ext.tcl
- this file contains useful extensions of tcl commands
NO namespaces are used but commands may start and end with an _
[author: Franc Brglez and Hemang Lavana]
@date original code back to 1999
- blocksDRC4cnfx_SA
- creates a cnf-format problem instance from two given
instances. The new instance has the originals as blocks along the diagonal
with optional random nonzeros added in new rows and columns.
[author: Franc Brglez]
@date 2006
- cnf2display
- displays a cnf[x] file in a window so that the nonzeros
show up as K x K pixels (K is specified by the user); The user
can also specify the size of the display or just its height
(since height is usually the limiting factor). These have
default values given at the start of the script.
Usage: cnf2display input_file pixels [ height | width height ]
[author: Matt Stallmann]
@date 2007/01/29
$Id: cnf2display 23 2007-05-18 21:03:28Z mfms $
- cnf2dot
- converts the constraint matrix of a mincost sat instance to a
bipartite graph in .dot format (the format used by crossing
minimization software). Assumes that there is exactly
one line per clause after the comments and the 'p' line (for
simplicity; a C program would be easier if this assumption were
not true).
Works only for cnf format, but cnfx2dot handles cnfx format.
Usage: cnf2dot input_file output_file
[author: Matt Stallmann]
@date 2006/04/13
$Id: cnf2dot 9 2007-05-01 14:28:12Z mfms $
- cnf2lpx.tcl
- tcl script that reads a min-cost sat instance in cnf format
(used by our programs) and converts it to lpx format (used by CPLEX and
other IP solvers)
[author: Matt Stallmann, 03 Jun 2004 (originally called scf2lpx.tcl)]
Usage: cnf2lpx.tcl [-no-comments] inputFile outputFile
$Id: cnf2lpx.tcl 9 2007-05-01 14:28:12Z mfms $
- cnf2mps.tcl
- tcl script that reads an unweighted min-cost sat instance
in cnf format
and produces an equivalent integer program in MPS format (used by some
IP solvers, most of which also accept lpx format, so this is deprecated).
[author: Matt Stallmann, 23 Oct 2003]
- cnf2ord
- converts the constraint matrix of a mincost sat instance to a
simple .ord file that orders the rows and columns as originally
given. Designed to be used with cnf2dot. The .ord format is
used by crossing minimization software to specify an initial
ordering on which most of the heuristics depend.
Usage: cnf2ord input_file output_file
[author: Matt Stallmann]
@date 2006/04/13
$Id: cnf2ord 9 2007-05-01 14:28:12Z mfms $
- cnf2positive
- converts a file in cnf[x] format so that the result has no
negative literals (by simply deleting negative literals).
Usage: cnf2positive input_file output_file
[author: Matt Stallmann]
@date 2007/01/29
$Id: cnf2positive 9 2007-05-01 14:28:12Z mfms $
- cnfClass2lpxClass
- transforms a given class of cnf or cnfx instances to
an equivalent class of lpx instances.
Usage: cnfClass2lpxClass CNF_DIR
where CNF_DIR is the directory to be translated to lpx
(must be relative to current directory)
The result is a directory called CNF_DIR-lpx
IMPORTS (must be in the path):
cnf2lpx.tcl - to convert an individual cnf/cnfx file to lpx format
@todo
- not working for cnfx at the moment but it's a simple fix
[author: Matt Stallmann]
@date 2007/05/01
$Id: cnfClass2lpxClass 16 2007-05-04 00:47:47Z mfms $
- cnfx2dot
- the weighted version of cnf2dot. The input is in cnfx rather
than cnf format.
Usage: cnfx2dot input_file output_file
[author: Matt Stallmann]
@date 2006/04/13
$Id: cnfx2dot 9 2007-05-01 14:28:12Z mfms $
- createBlockClass
- a script for creating a class of block-structured
instances.
Usage: createBlockClass NUM_INSTANCES TARGET_ROOT_DIR
BASE_INSTANCE NUM_BLOCKS NUM_ROWS OVERLAP SEED
where
NUM_INSTANCES = the number of instances in the class,
TARGET_ROOT_DIR = root directory under which the class directory
will be stored
BASE_INSTANCE = a .cnf file
NUM_BLOCKS = the number of copies of the base instance (blocks)
in each instance of the class
NUM_ROWS is the number of extra rows to be added
each time the number of blocks doubles (roughly)
OVERLAP is the the number of non-zeros by which the added rows
overlap each block.
SEED = three integers in the range [0,65535] separated by commas
Instances are named ixxxx, where xxxx is a 0-padded version
of a number from 1 to NUM_INSTANCES.
The instances are stored in a directory called
base_BC_blocks_rows_overlap
where base is BASE_INSTANCE with no .cnf extension and
the remaining items are 0-padded, size-3 fields with the
appropriate numbers. Blocks are preceded by b, rows by r, and overlap by o.
IMPORTS (these have to be in the path of executables):
- genBlocks: to create each instance
- morph: used by genBlocks
- blocksDRC4cnfx_SA: used by genBlocks
- new_seed: used to generate new random seeds (also
used by genBlocks)
[author: Matt Stallmann]
@date 2007/05/01
$Id: createBlockClass 15 2007-05-03 23:51:59Z mfms $
- createIsoClass
- a simple script for creating a class from a reference
instance.
Usage: createIsoClass REF_INSTANCE CODE SEED SIZE
TARGET_ROOT_DIRECTORY
where REF_INSTANCE is a .cnf or .cnfx file, CODE is in the CLRX format
expected by morph, SEED is three integers in the range [0,65535] separated
by commas, SIZE is the number of instances in the class, and
TARGET_ROOT_DIRECTORY is the directory one level above the class directory
(whose name is based on the REF_INSTANCE).
IMPORTS:
- morph: to create each isomorph
@todo
- Get rid of CODE (use CR always)
- Change order of args to be consistent with createBlocksClass
- Distinguish between relative and absolute path for TARGET_ROOT_DIRECTORY
[author: Matt Stallmann]
@date 2006/08/15
$Id: createIsoClass 11 2007-05-01 15:57:09Z mfms $
- dot2ord
- creates a .ord file from a .dot file by taking the nodes in
order of appearance.
Assumes that each edge of the dot file is on a separate line
and that comments are single line.
(as is the case with files created by cnf2dot)
Usage: dot2ord dot_file ord_file
[author: Matt Stallmann]
@date 2006/04/13
$Id: dot2ord 9 2007-05-01 14:28:12Z mfms $
- genBlocks
- script for creating a block-structured instance whose blocks
are a given base instance.
Usage: genBlocks BASE_INSTANCE NUM_BLOCKS NUM_ROWS OVERLAP SEED
where BASE_INSTANCE is a .cnf file,
NUM_BLOCKS is the number of
copies of the base instance,
NUM_ROWS is the number of extra rows to
be added each time the number of blocks doubles,
OVERLAP is the
the number of non-zeros by which the added rows overlap each block
SEED is three integers in the range [0,65535],
separated by commas.
The resulting instance has name base_blocks_rows_overlap.cnf,
where base is BASE_INSTANCE without the .cnf,
blocks the number of blocks, rows the number of added rows,
and overlap the overlap described above.
All numbers are padded with 0's to width 3. Blocks are preceded by b, rows
by r, and overlap by o.
IMPORTS (these have to be in the path of executables):
blocksDRC4cnfx_SA: creates a single instance from two blocks
morph: scrambles (permutes) a given instance
new_seed: creates a new seed in the IEEE-48 sequence
[author: Matt Stallmann]
@date 2007/04/30
$Id: genBlocks 15 2007-05-03 23:51:59Z mfms $
- improveOrder
- uses a treatment for bigraph crossing minimization in
order to improve the ordering of rows and columns of a constraint
matrix.
Usage: improveOrder input_file treatment_number output_file
[author: Matt Stallmann]
@date 2006/07/10
$Id: improveOrder 16 2007-05-04 00:47:47Z mfms $
- latexTable
- Script to convert output data from an experiment to a latex
table entry
!!! Under construction
- res2ltx
- Script to convert data from an umbra run to a latex table entry
Usage: res2ltx input_file table_label [search_expr instances UB]
defaults: search_expr = SimplexTime, instances=129
[author: Matt Stallmann]
@date 2006/12/30
$Id: res2ltx 24 2007-05-18 21:04:23Z mfms $
Matthias F. (Matt) Stallmann
(Matt underscore Stallmann at ncsu dot edu)
Wed Jun 6 11:02:01 EDT 2007