lrslib(5)
๐ธ lrslib โ the whole vibe ๐
ok so bestie, welcome to lrslib, version 7.3 โ the manual page, the lore, the moment. This is the page that tells you what the whole lrslib family does, and honestly? It's giving "small library, absolutely enormous brain". ๐
Here's the elevator pitch, in the original's own words: convert between representations of convex polyhedra, remove redundant inequalities, find minimum representations, convex hull computation, solve linear programs in exact precision, compute Nash-equilibria in 2-person games. Like. Slay. ๐
โจ NAME โจ
lrslib โ it converts between representations of convex polyhedra, it removes redundant inequalities, it finds minimum representations, it does convex hull computation, it solves linear programs in exact precision, and it computes Nash-equilibria in 2-person games. That's the whole rรฉsumรฉ. Main character energy fr fr. ๐
๐ SYNOPSIS ๐
Here's every single invocation, copied character for character because we do not play with the commands:
lrs [input-file] [output-file]
redund [input-file] [output-file]
minrep [input-file] [output-file]
fel [input-file] [output-file]
mpirun -np num-proc mplrs input-file [output-file] [options]
lrsnash [options] [input-file]
hvref/xvref [input-file]
polyv [input-file]
๐ฆ DESCRIPTION ๐ฆ
ok so here's the tea. ๐ซ
A polyhedron can be described by a list of inequalities (that's the H-representation) or as a list of its vertices and extreme rays (that's the V-representation). lrslib is a C library containing programs to manipulate these representations. And the part that makes me feral? All computations are done in exact arithmetic. No float nonsense. None. ๐โจ
lrs(1) converts an H-representation of a polyhedron to its V-representation and vice versa โ known respectively as the vertex enumeration and facet enumeration problems (peep Example (1) below ๐). lrs can also be used to solve a linear program, remove linearities from a system, and extract a subset of columns. Multi-talented icon. ๐
redund(1) removes redundant inequalities in an input H-representation and outputs the remaining inequalities. For a V-representation input it outputs all extreme points and extreme rays. Both outputs can be piped directly into lrs. And plot twist: redund is a link to lrs which performs these functions via the redund and redund_list options. Sneaky. Obsessed. ๐
minrep(1) performs the same functions as redund(1) but in addition searches for hidden linearities in the input. These are made explicit in the output, which is a minimum representation of the polyhedron. It said "let me find the secret ones too" and honestly? Ate. ๐ฅ
fel(1) projects an input H-representation onto a given set of variables using Fourier-Motzkin elimination. For a V-representation it extracts the specified columns. The output is non-redundant and can be can be piped directly into lrs. (yes, the "can be can be" is the original's, and I'm keeping it, no notes ๐). fel is a link to lrs which performs these functions via the eliminate and project options.
mplrs(1) is Skip Jordan's parallel wrapper for lrs/redund/minrep/fel. Parallel. Wrapper. We love a collaborative queen. ๐ง
lrsnash(1) is Terje Lensberg's application of lrs for finding Nash-equilibria in 2-person games. Game theory bestie. ๐ฎ
hvref(1) and xvref(1) produce a cross reference list between H- and V-representations. Very "here's who knows who". ๐ซถ
polyv(1) is Skip Jordan's utility to create logical formulas for checking equivalence between H- and V- representations, or determining whether a given inequality is redundant after eliminating variables, without eliminating the variables. Yes. The math version of doing it without doing it. Iconic. โญ
๐งฎ ARITHMETIC ๐งฎ
ok so this is the section where things get numerically spicy. ๐ถ๏ธ
lrsarith(5) โ from version 7.1, lrs/redund/mplrs use hybrid arithmetic with overflow checking, starting in 64bit integers, moving to 128bit (if available) and then GMP. It's a whole glow-up pipeline for numbers.
Overflow checking is conservative to improve performance: eg. with 64 bit arithmetic, a*b triggers overflow if either a or b is at least 2^31, and a+b triggers an overflow if either a or b is at least 2^62. Yes bestie, that's aggressive and yes, it's on purpose. ๐ค
Typically problems that can be solved in 64bits run 3-4 times faster than with GMP and inputs solvable in 128bits run twice as fast as GMP. Speed. ๐จ
Various arithmetic versions are available and can be built from the makefile. Build her up. ๐ ๏ธโจ
๐ NOTES ๐
User's guide for lrslib
go read it, it's the extended lore. ๐
๐ AUTHOR ๐
David Avis <avis at cs dot mcgill dot ca >
๐ SEE ALSO ๐
lrs (1),redund(1),minrep(1),mplrs(1),fel(1),lrsnash(1),hvref(1),xvref(1),polyv(1),lrsarith(5)
and that's the whole page bestie!! ๐ this is lrslib version 7.3, dated January 2024 / 2024.01.31. exact arithmetic, exact vibes, no cap. periodt. ๐โจ๐ฆ
๐ฆ where this page comes from
- fedora 43: lrslib-devel 7.3-6.fc43 ยท GPL-2.0-or-later
- fedora 43: lrslib-devel 7.3a-1.fc43 ยท GPL-2.0-or-later
- fedora 44: lrslib-devel 7.3a-3.fc44 ยท GPL-2.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms