1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661
|
README file for lrslib : reverse search vertex enumeration program/CH package
-----------------------------------------------------------------------------
Documentation is currently being maintained at the URL:
http://cgm.cs.mcgill.ca/~avis/C/lrs.html
-----------------------------------------------------------------------------
Version 7.3
manual: http://cgm.cs.mcgill.ca/~avis/C/lrslib/USERGUIDE73.html
2024.1.31
New features:
lrs is now multithreaded with limited parallelization on a shared memory machine using
OpenMP. lrs now evaluates in parallel all children of the root in the search tree.
minrep Finds any hidden linearities and removes redundancy giving a H/V description
with minimum number of rows
mplrs -minrep Fully parallelized version of minrep, replaces "mplrs -redund"
mplrs -fel Does a fully parallel LP redundancy removal in one step of Fourier-Motzin
elimination.
Major changes in polyv relative to 7.2:
1. renamed from checkpred, but remains compatible with 7.2 style usage.
2. new features: check equivalency between H/V representations (possibly
after projections) using SMT solvers, see the polyv man page for details.
Windows users: recommended to install lrslib using the Windows/WSL Debian or Ubuntu layer
otherwise in powershell win.bat may produce lrs.exe and lrsgmp.exe
if a relatively recent version of gcc is available - no guarantees!
2023.11.23
single processor
minrep: find a minimum representation ignoring any project/eliminate option
redund: remove redundant rows from the input ignoring any project/eliminate option
if testlin present do minrep
fel: Fourier-Motzkin elimination ignoring any redund/redund_list options
No project/eliminate option: last column eliminated
lrs: H-V transformation unless testlin/redund*/project/eliminate options present
testlin only: check for relative interior point and terminate
redund/redund_list only: same as redund
redund/redund_list+teslin: same as minrep
project/eliminate only: same as fel
both redund/redund_list and project/eliminate: last input wins
multiple processors
mplrs -minrep find minimum representation
any project/eliminate option should be ignored
mplrs -fel parallel version of lrs with project/eliminate option
No project/eliminate option: last column eliminated
Assumes input is a minrep, if not it does a minrep instead of fel
mplrs both redund/redund_list and project/eliminate options present: last input wins
-----------------------------------------------------------------------------
Version 7.2
manual: http://cgm.cs.mcgill.ca/~avis/C/lrslib/USERGUIDE72.html
2021.6.04
Patches carried over from lrslib-071b release:
Added patches 1,2, and 4 supplied by the Julia group:
https://github.com/JuliaPackaging/Yggdrasil/tree/master/L/lrslib/bundled/patches
The no128bit.patch removes 128-bit support and was not used.
makefile updates
install lrsrestart.h in install-common (thanks to Philipp-Joachim Ost for the report).
Update makefile to ease building on 32 bit architectures.
redund bug reported by Eric Petersen where output can be lost in arithmetic change
Fixed in lrslib.c around l. 6367
2021.5.19
1. maxdepth lrs option now works with mplrs
2. mplrs renumbers B# when printcobasis is set in lrs causing global B# numbers to be output
3. various shell scripts are now in the scripts directory
plotB produces a plot from mplrs output showing B# and height for each new vertex/ray/facet output
2021.5.5
Running mplrs with gcc version 10.2.0 issues (no action needed)
setenv PMIX_MCA_gds hash
to avoid
%lg PMIX ERROR: ERROR in file /pub/devel/openmpi/v4.1/openmpi-4.1.0-1.x86_64/src/openmpi-4.1.0/opal/mca/pmix/pmix3x/pmix/src/mca/gds/ds12/gds_ds12_lock_pthread.c at line 168
see: https://github.com/open-mpi/ompi/issues/7516
2020.11.18
% make lrsmp
will produce a binary that uses hybrid arithmetic with the built in mp package and does not
need dynamic load libraries
2020.7.25
The eliminate/project options does Fourier Elimination for H-rep or extract columns
and redundancy removal for V-rep.
eliminate k i_1 i_2 .. i_k
eliminates variables in an H-representation corresponding to cols i_1 .. i_k. Col zero cannot be eliminated.
Variables are eliminated in the order given.
project k i_1 i_2 .. i_k
projects an input H-rep with cols 0 1 2 .. n-1 onto cols 0 i_1 .. i_k. Col zero always kept.
Variables are eliminated are those not in the list, from smallest to largest.
Implemented for mplrs on H-representations where it will eliminate the first variable
on the eliminate list. The script mfel iterates mplrs k times to eliminate all k variables.
Usage:
% mfel file.ine k np where np=number of processors to use.
-----------------------------------------------------------------------------------
lrs currently runs in 4 modes depending on presence of options: extract/project/redund
In case more than one option is provided the last one overides the others.
modes:
default: none of those options, H/V to V/H conversion
redund: remove redundant lines in input
extract: remove linearities for H, extract columns for V
project: fourier elimination
-----------------------------------------------------------------------------
Version 7.1
manual: http://cgm.cs.mcgill.ca/~avis/C/lrslib/USERGUIDE71.html
2020.5.25
Version 7.1 is a major revision completing the move to an all C library begun
in 7.0 which was work in progress and has been removed from distribution.
Major changes to lrs:
1. redund function is now performed by lrs via options, but legacy redund maintained
2. extract option to extract columns from the input especially with linearities
3. hvref makes a cross reference list between H and V representations
Major changes to mplrs:
1. Temporary files no longer used for communicating with workers.
2. Parallel version of redund is now available
Thanks to David Bremner and Jerry James for advice, patches and other help!
Details below
2020.5.19
redund binaries are no longer produced and lrs does redund
functioning via the redund option. For a standard redund run (ie all lines checked)
set up a link:
%ln -s lrs redund and if needed %ln -s lrs1 redund1 etc. for single arithmetic
Now no options are needed and
% redund filename
will remove all redundant inequalities
In mplrs this can be achieved by:
% mpirun -np <procs> mplrs -redund filename
2020.4.27
Changes in mplrs relative to 7.0:
1. All C++ code removed or rewritten in C; C++ compiler no longer required.
2. mplrs uses the new lrslib API (2019.11.8) instead of temporary files for
parallel jobs.
3. Support for parallel redund runs using the redund option in input files.
4. Compiler warnings removed.
5. Additional warning and informational messages printed when relevant.
6. New option -redund, for redund runs without adding option to file.
7. Avoid duplicate output lines that were possible on an overflow in
hybrid mode.
8. Fix a rare bug that could omit output lines at the start of a run.
2020.2.5
The extract option is a preprocessing step to remove linearities (if any) and resize
the A matrix using standard lrs processing, which is output as a valid lrs input file.
The resulting file will not contain any equations but may not be full dimensional.
Options in the input file are stripped.
User can specify the cols to retain (where this possible by linear independence).
If there are no linearities in the input file the columns in the option are retained
and the other ones are deleted. This is useful for projecting a V-representation.
extract 0
retains columns in order 1,2,...,n
extract k i1 .. ik
retains columns in order i1,...,ik then the missing 1..n as necessary
Column 0 is always retained.
Use redund to remove redundancies from the output as necessary.
A full lrs run is not performed, however output can be piped:
% lrs file | redund | lrs
2019.12.30
hvref makes a cross reference list between H and V reps
Usage (same for ext file):
Add printcobasis and incidence options to cube.ine
% lrs cube.ine cube.ext
% xref cube.ext
Edit the output file cube.ext.x so that the second line contains two integers
rows maxindex
where rows >= # output lines in cube.ext.x
maxindex >= # input lines in cube.ine
or just use 0 0 and the program will tell you which values to use
% hvref cube.ext.x
2019.11.8
New redund option causes lrs to perform redund function:
redund start end
limits redundancy checking to input rows numbered start,...,end.
Defaults start=1 and end=m is legacy redund and can be obtained by
redund 0 0
lrs_main has been rewritten as lrsv2_main to avoid temporary files in mplrs.
It now passes pointers to P and Q back to mplrs and is called 3 times
according to the stage flag.
stage=0 performs problem setup and reads the input file
stage=1 performs reverse search or redund function
stage=2 performs clean up and closes files
2019.6.13
If lrs is compiled with -DLRS_QUIET lrs produces an output file with only the data
between the begin and end lines, ie. a matrix of the V or H representation.
The only exception is if the input is a V-rep and output has linearities
in which case line one has the linearity information
--------------------------------------------------------------------------------------
2019.1.5
Various pivot rules are implemented for solving LPs using variations of the lponly option.
To get pivot counts correct it is best to use lrsgmp at least for now
lponly default, currently Dantzig's rule
lponly_b Bland's rule, which is used for vertex enumeration
lponly_d Dantzig's rule, the only rule used up to Version 7.1
lponly_r random edge rule
lponly_rd alernates random edege and Dantzig
-----------------------------------------------------------------------------
2018.7.1
Version 7.0 (lrslib-070)
User's guide: http://cgm.cs.mcgill.ca/~avis/C/lrslib/USERGUIDE70.html
Recommended makes:
%make # lrs,redund(hybrid arithmetic), lrsgmp, redundgmp
%make mplrs # mplrs(hybrid arithmetic), mplrsgmp
1. hybrid (64bit/128bit/GMP) arithmetic implemented:
speedups of roughly 3-5 times (64bit) and 2 times(128bit) over GMP for problems using small integers.
2. overflow checking for 64/128 bit arithmetic
3. __int128 (gcc v.4.6.0 or later) and FLINT arithmetic now supported
4. lrsgmp, mplrsgmp uses only GMP arithmetic, same as lrslib-062
5. lrs/redund/mplrs start in 64 bit moving to 128 bit and then to gmp arithmetic as necessary
6. single arithmetic versions of lrs/mplrs available for comparison purposes
7. single arithmetic versions of lrsnash are available with overflow checking
8. plrs is no longer supported
9. removing the -DSAFE option disables overflow checking in 64/128 bit mode and results are unpredicable if overflow occurs
10. mplrs now prints maximum tree depth at end and supports printcobasis option in input files
Shared library:
To make just the shared library, and appropriate symlinks,
% make liblrs.o
This is a *multiarithmatic* library that contains the lrslib API
suffixed with _1, _2, and _gmp. To use as a replacement for the old liblrsgmp.so, use
CFLAGS+= "-DGMP -DMA"
The -DMA is new, and enables rewriting of your existing function call
lrs_foo(...) to lrs_foo_gmp(...). This is C preprocessor macros, and
is optional, you can also call the _1, _2, and _gmp versions
directly.
-----------------------------------------------------------------------------
2016.5.27
Several changes to mplrs:
1. New command-line options -countonly, -stopafter <n>, -maxbuf <n>.
2. Volume output.
3. Counting statistics on number of jobs, size of L, number of times
empty changed to longs.
4. Performance improvements for problems with large outputs.
-----------------------------------------------------------------------------
2016.3.28
Changed default to 64-bit arithmetic when using lrslong and lrsmp arithmetic.
For 32bit machines a -DB32 compile flag is now required for make allmp and
for compiles of lrs1/mplrs1/plrs1.
-----------------------------------------------------------------------------
2016.1.18
countonly option follows the end line and suppresses output of vertices/rays/facets
2015.11.20 Current version is lrslib-061 Version 6.1
1. Contains lrsnash.c and lrsnashlib.c replacing nash.c with a library version and simpler interface
that does not require setupnash. Big thanks to Terje Lensberg for this.
nashdemo.c is a very basic template for setting up games and calling the library function lrs_solve_nash(game *g).
To compile:
% make lrsnash
you get binaries lrsnash and nashdemo.
% nashdemo just runs the demo, no parameters
% lrsnash game finds the equlibrium for game, which is in setupnash format (recommended!)
% lrsnash game1 game2 finds the equilibrium for the same game in legacy nash format
The usersguide will be updated in due course
2. mplrs, plrs, lrs had some memory leaks and a few other issues that are fixed in this release (hopefully and thankfully)
--------------------------------------------------------------------------------
2015.10.10
memory leak in nash fixed
2015.10.3
OpenMPI has memory leaks in version 1.8.6. We tested mplrs with version 1.10.0
and found no leaks.
2015.9.16
Bug in nash caused by duplicated rows and columns fixed
2015.9.14
Fixed some lrs memory leaks caused by nonnegative and linearity output
2015.7.13
This a major revision of lrslib which contains mplrs.c, the MPI parallel version of lrs written by Skip Jordan and derived from plrs which was written by Gary Roumanis.
Tests of mplrs on Tsubame2 with up to 1200 cores by Kazuki Yoshizoe show near linear speedups. lrs has some new options which are primarily for use by mplrs.
To install mplrs see: http://cgm.cs.mcgill.ca/~avis/C/lrslib/USERGUIDE.html#mplrs
You will need an MPI library and mpic++ installed.
If you feel lucky try:
% make mplrs
Defalut usage:
% mpirun -np p mplrs <infile> [ <outfile> ]
where p>3 is the number of core to be used.
If you use openmpi the hosts available and slots on each host may be in
/usr/local/etc/openmpi-default-hostfile
Other options available are described in http://cgm.cs.mcgill.ca/~avis/C/lrslib/USERGUIDE.html#mplrs
In particular plots can be made during the mplrs run of the job queue length, number of processors active etc.
The makefile was modified by David Bremner. Please direct any complaints to bremner@unb.ca
New option:
maxcobases n
After maxbases have been generated the cobases of the unexplored subtrees are reported.
Each of these can be restarted as a separate lrs run with suitable mindepth option set
------------------------------------------------------------------------------
Older versions
2014.12.4
With gcc 4.8 plrs does not compile. Changed memory ordering (plrs.cpp line 168) from
plrs_output* consume_list = output_list.exchange(0,boost::memory_order_consume);
to
plrs_output* consume_list = output_list.exchange(0,boost::memory_order_acquire);
For more details see here:
https://bitsharestalk.org/index.php?topic=15.msg14109#msg14109
To get plrsmp to compile I converted the length macro to a function call (conflict with str1.length in lrslib.c line 2792)
2014.12.2
From version 1.56.0 the boost library contains the Atomic library, so boost_atomic is no longer included in the lrs distribution.
The instructions below for installing plrs are now simpler.
-----------------------------------------------------------------------------
2014.9.27
lrslib-050 released
lrslib-050 contains a multi-thread version of lrs called plrs. The input/output files for plrs are the
same as for lrs, however plrs is intended just for vertex or facet enumeration, and other functionality
of lrs is not available.
Usage is
% plrs <infile> [ <outfile> ] [ -mt <max threads> ] [ -id <initial depth> ]
-mt <max threads> specifies the number parallel threads calling lrs (default 12)
-id <initial depth> specifies the initial depth of the RS tree to generate before parallelization (default 5)
Setup instructions for plrs. Use version 1.57.0 or later of the boost libary
1. Install boost library from http://www.boost.org/ into prefix/boost157
If you have root permission, prefix=/usr/include (or just do not specify it)
However you can install boost locally wherever you like.
Instructions for installing the library are located here
http://www.boost.org/doc/libs/1_57_0/more/getting_started/unix-variants.html.
Look at section 5 for an easy install.
***Important: make a note of the path given at the end of the install process ****
2. Update the makefile to include the paths you recorded in step 1.
"make plrs" will make plrs with the gmp library (assuming the gmp library is already installed on that machine).
"make plrsmp" will make plrs with the standard lrsmp arithmetic library and plrs1 with the long integer library.
-------------------------------------------------------------------------------
2013.5.22 modification to printcobasis so that the objective value is printed
------------------------------------------------------------------------------
2012.9.27 initial release of multithread version of lrs called plrs that uses a wrapper
written by Gary Roumanis. It needs the Boost libraries at http://www.boost.org
plrs setup instructions are in the file readme_plrs
I regret that I cannot give any additional support for the correct installation of boost libraries.
Note: makefile has now changed so that
make all gives gmp arithmetic library
make allmp uses native mp arithmetic if gmp not available
-----------------------------------------------------------------------------
2010.5.7 incidence no longer resets printcobasis frequency to zero.
If the printcobasis n option is used, the frequency will be n.
Otherwise the default n=0 is used, and cobasis is printed only for lexmin bases.
-----------------------------------------------------------------------------
2010.4.26 bug when incidence and nonnegative options used together reported by
Jochen Koenemannkfix was fixed.
Bug in fourier reported by Laszlo David for input which is not full
dimensional. I am temporarily removing fourier from distribution.
-----------------------------------------------------------------------------
2009.12.2 bug fix for redund caused problems in nash, reported by James Heather.
Hopefully this new version solves both issues.
-----------------------------------------------------------------------------
2009.9.10 bug in redund reported by Alden Walker, when linearities are redundant, has been fixed.
It is now under test, so please report any bugs!
this bug also can cause printcobasis option to be incorrect for lrs under this condition.
Problems still seem to arise in fourier from time to time, so please report any anomalities.
-----------------------------------------------------------------------------
2009.2.5 bug in fourier when using linearity option pointed out by Conor Meagher. Option disabled.
2nash driver uses two processors to run nash with input files in both orders.
terminates when first process terminates. Thanks again to Conor for this.
-----------------------------------------------------------------------------
2007.6.6 printcobasis output line modified to give also in_det
det= the determinant of the current basis, which is always integer.
in_det= the determinant of the input rows corresponding to the current basis. lrs rescales input rows if they are rational or have a common divisor, so in these cases det and in_det are different.
For V-representation, the volume will be the sum of the in_det of
each basis, divided by the dimension (n-1)!
-------------------------------------------------------------------
2006.10.31 Modified code for restartpivots, to allow DB to do something.
Estimator now provides estimate of running time=time*bases/tree nodes
Triangulation printed if getvolume and verbose options used
-----------------------------------------------------------------------------
2006.10.11 Bug fix for nash, and inclusion of polytope version
-----------------------------------------------------------------------------
available by using setupnash2
-----------------------------------------------------------------------------
2006.3.1 incidence option now can be used compatibly with printcobasis n
-----------------------------------------------------------------------------
2006.2.14
Version 4.2b
Bug fixed related to memory allocation for linearity reported by David Haws.
If you use the linearity option, you should upgrade to this version.
In the case of inconsistent linearities, the first inconsistent linearity
is now reported before termination.
----------------------------------------------------------------------------
2005.11.20
Version 4.2a
Bug fixed relating to miscaled lp dual variables output when lponly set
maxoutput n Option limits output lines to n: either rays+vertices, or facets
----------------------------------------------------------------------------
2005.6.1
Version 4.2 with two new drivers:
nash.c which computes all Nash equilibria of a two person non-cooperative game,
and uses setupnash.c to create the input files.
fourier.c which does Fourier elimination on an H-representation to project it to
a lower dimensional space. Contributed by Tallman Nkgau.
Other changes: lrs with the lponly option now provides dual variables for the
optimum solution.
Bug fix to mpdouble (reported by several users.)
_____________________________________________________________________________
2004.9.23
Version 4.2 updated with a patch from Bremner that has something to do with C++.
2003.10.24
Version 4.2 which appears here is a prerelease version, is not fully tested,
and will be modified frequently. However you are more than welcome to try
it - please report any bugs! Merci beaucoup.
2002.10.28
lrslib v.4.2 minor modifications to v.4.1
This is a pre-release for test purposes. Please report bugs!
Nonnegative option was fixed to allow input where origin is not necessarily
a vertex.
A memory leak was fixed.
A quiet mode is added - compile with LRS_QUIET set.
------------------------------------------------------------------------------
2001.6.20
lrslib v.4.1
lpsolve like procedures to build input data added. Demo programs are:
vedemo.c vertex enumeration
chdemo.c facet enumeration
lpdemo.c linear programs
They can be build using: make demo
Proper garbage collection implemented to clean up after each problem has been
solved. See
http://cgm.cs.mcgill.ca/~avis/C/lrslib/lrslib.html
for documentation.
-------------------------------------------------------------------------------
2000.6.14
Various binaries are available in the directory binaries.
Currently available:
binaries/debian Debian Linux
binaries/sun Sun Ultra Sparc
binaries/win98 Windows 95/98
------------------------------------------------------------------------------
2000.6.14
lrslib v.4.0 which
supercedes all previous versions of the programs lrs and redund.
New Features:
------------
1. Library version allows customization of the search function, access to the
output as it is produced, and access to lrs from other programs.
2. Problems need no longer be in full dimension. This allows the
input of equations, partial enumeration on facets, ridges etc.
3. Choice of arithmetic packages. Currently available are:
lrsmp Extended precision arithmetic used in previous releases
lrslong Fixed length long integer arithmetic. No overflow checking
but 5-10 times faster.
lrsgmp Requires preinstallation of GNU GMP package, available at
http://www.swox.com/gmp/
The standard "make all" gives lrs/redund with lrsmp, and lrs1/redund1 with lrslong.
4. redund was completely rewritten and is faster than before. The previous
version did not remove redundancy in the starting basis and should be
discarded.
Installation:
------------
1. From website go to "Download" and retrieve the file lrslib-040.tar.gz
2. Unpack with:
% gunzip lrslib-040.tar.gz
% tar xvf lrslib-040.tar
3. Go to the new directory
% cd lrslib-040
4. make binaries by typing
% make all (most 32 bit unix machines)
or
% make all64 (64 bit integer machines such as DEC Alpha)
If the make fails, it is usually due to timing and/or interrupt handling
routines. In this case try:
% make nosigs
5. If successful you should get binaries: lrs redund lrs1 redund1
6. Test the program lrs by typing:
lrs cube.ine
and you should get output resembling the file cube.ext
7. You will find additional test files in the directories: ine and ext
8. For GNU gmp library, edit the makefile to set the INCLUDE and LIB paths for
the location of the gmp libarary, and type:
%make gmp
You should get binaries glrs and gredund
|