polytope compute with 'INEQUALITIES' -> lattice points

Questions and problems about using polymake go here.
thelle
Posts: 3
Joined: 15 Jun 2011, 11:35

polytope compute with 'INEQUALITIES' -> lattice points

Postby thelle » 15 Jun 2011, 12:33

Hello,

I think I need your help. My general Problem is, that I have 55 inequalities and 55 variables and I need to know the lattice points. In fact I know that there exist at least 2 of them. Its because my problem is a test problem.
As written in the documentation, I used the following code to produce my polytope:

$inequalities=new Matrix<Rational>([...]);
$p=new Polytope<Rational>(INEQUALITIES=>$inequalities);

The problem is, that polymake tells me, that the polytope has no Vertex. So that my polytope is empty. This can't be correct, because i know points, that verify the inequalities.

I hope you can help me.

Torsten

PS:

I got this error message:

print $p->LATTICE_POINTS;

polymake: WARNING: rule VERTICES_IN_INEQUALITIES : INEQUALITIES, VERTICES failed: attempt to use a property VERTICES with undefined value
polymake: WARNING: rule N_VERTICES : VERTICES failed: attempt to use a property VERTICES with undefined value
polymake: WARNING: rule BOUNDED : VERTICES | POINTS failed: attempt to use a property VERTICES with undefined value
polymake: WARNING: rule DIM : VERTICES | POINTS failed: attempt to use a property VERTICES with undefined value
polymake: WARNING: rule FAR_FACE : VERTICES failed: attempt to use a property VERTICES with undefined value
polymake: WARNING: rule AFFINE_HULL : VERTICES | POINTS failed: attempt to use a property VERTICES with undefined value
polymake: WARNING: rule lrs.convex_hull.count: N_VERTICES, N_BOUNDED_VERTICES, POINTED, FEASIBLE, LINEALITY_DIM : FACETS | INEQUALITIES failed: killed by signal

polymake: ERROR: no more rules available to compute 'LATTICE_POINTS'



The system is Ubuntu 11.04.

Welcome to polymake version 2.9.9, released on November 05, 2010
Copyright (c) 1997-2010
Ewgenij Gawrilow, Michael Joswig (TU Darmstadt)
http://www.polymake.de

Application polytope currently uses following third-party software packages:
cddlib, jreality, lrslib, nauty

User avatar
joswig
Main Author
Posts: 282
Joined: 24 Dec 2010, 11:10

Re: polytope compute with 'INEQUALITIES' -> lattice points

Postby joswig » 17 Jun 2011, 09:44

Please send the input. Just one thought: if your coordinates are very long integers use quotes, such as "1234568789".

See http://www.polymake.org/doku.php/tutori ... o_tutorial.
Last edited by joswig on 17 Jun 2011, 09:56, edited 1 time in total.

herr
Developer
Posts: 40
Joined: 30 Dec 2010, 13:15

Re: polytope compute with 'INEQUALITIES' -> lattice points

Postby herr » 17 Jun 2011, 09:53

As written in the documentation, I used the following code to produce my polytope:

$inequalities=new Matrix<Rational>([...]);
$p=new Polytope<Rational>(INEQUALITIES=>$inequalities);
Right, this is exactly the way it should work.
The problem is, that polymake tells me, that the polytope has no Vertex. So that my polytope is empty. This can't be correct, because i know points, that verify the inequalities.
Hm, that's strange. Where do the inequalities come from? Did you type them in by hand or did you load a file? Just to make sure that it is not an input problem: could you please check your input by

Code: Select all

print_constraints($inequalities);
Is the input correct?

thelle
Posts: 3
Joined: 15 Jun 2011, 11:35

Re: polytope compute with 'INEQUALITIES' -> lattice points

Postby thelle » 17 Jun 2011, 10:20

The inequalities were taken from a program coded with PARI. I put the input in by hand. I just copy the code from the 18-7-5test.txt.


I checked the input, but I get the following output:

polytope > print_constraints($inequalities);

polymake: ERROR: Undefined subroutine &Polymake::User::print_constraints called.


I also added the code and the original output from PARI.
Attachments
Downloads.tar.gz
(8.11 KiB) Downloaded 522 times
18-7-5test.txt.tar.gz
(8.3 KiB) Downloaded 503 times

paffenholz
Developer
Posts: 212
Joined: 24 Dec 2010, 13:47

Re: polytope compute with 'INEQUALITIES' -> lattice points

Postby paffenholz » 19 Jun 2011, 13:07

Your input defines an affine cone with 4900 rays and 2-dimensional lineality. This is not a feasible input for a polytope in all versions of polymake up to 2.9.9. Yet, polymake always assumes correct input; it never checks this, leading to sometimes unexpected results.

The recent version 2.10 can deal with your input correctly. However, if you want to compute lattice points of your object, then probably also your input is not what you wanted. It is unbounded, so there is no way to list or count all lattice points. Are your inequalities in the correct format: 0<=b+Ax?

User avatar
joswig
Main Author
Posts: 282
Joined: 24 Dec 2010, 11:10

Re: polytope compute with 'INEQUALITIES' -> lattice points

Postby joswig » 19 Jun 2011, 14:52

Is it possible that you forgot non-negativity constraints?

User avatar
joswig
Main Author
Posts: 282
Joined: 24 Dec 2010, 11:10

Re: polytope compute with 'INEQUALITIES' -> lattice points

Postby joswig » 20 Jun 2011, 11:11

I guess the attached file contains the correct descriptions of your matrix A and your right hand side b. Then you define your polytope like:

Code: Select all

polytope > $P=new Polytope(INEQUALITIES=>(unit_matrix(56)),EQUATIONS=>(-$b|$A));
Afterwards you can compute the vertices:

Code: Select all

polytope > print $P->VERTICES; 1 1624 2560 1904 768 576 2464 3584 4384 1792 112 768 17136 32256 23632 18176 9600 1792 1904 57024 111872 85536 57856 39584 18176 4384 2560 138264 252672 215200 158208 95108 57856 23632 3584 3248 3994 3328 112 6416 6144 544 0 45424 52224 6848 0 151904 189696 34624 768 361544 467968 113904 4352 4 1 17024/11 88456/33 20048/11 824 1672/3 7504/3 123088/33 135488/33 64120/33 0 824 16968 1055656/33 265440/11 200608/11 310360/33 64120/33 20048/11 1897696/33 334720/3 256048/3 633224/11 1319152/33 200608/11 135488/33 88456/33 1523536/11 2776088/11 7134640/33 1730096/11 3131452/33 633224/11 265440/11 123088/33 34048/11 43854/11 110144/33 3616/33 214048/33 18152/3 18704/33 8/33 496944/11 1734272/33 223264/33 0 5022352/33 6246808/33 1146512/33 25064/33 11943152/33 1402456/3 3762256/33 143992/33 20/11 1 1512 2728 5432/3 824 1672/3 7504/3 11368/3 12032/3 5936/3 0 824 16968 95648/3 72856/3 54640/3 28072/3 5936/3 5432/3 57696 111312 256048/3 172840/3 120208/3 54640/3 12032/3 2728 415688/3 757400/3 216320 157032 284036/3 172840/3 72856/3 11368/3 3024 3986 10016/3 328/3 6496 18112/3 1712/3 0 135376/3 157880/3 20224/3 8/3 456944/3 567352/3 104432/3 2248/3 1085624/3 467552 341912/3 13120/3 4/3
Or you can list the lattice points inside:

Code: Select all

polytope > print $P->LATTICE_POINTS; 1 1540 2686 1834 810 562 2492 3738 4104 1932 28 810 17010 31976 24122 18204 9418 1932 1834 57528 111452 85396 57674 39948 18204 4104 2686 138488 252518 216040 157326 94786 57674 24122 3738 3080 3988 3336 110 6476 6064 564 0 45200 52526 6768 2 152212 189262 34764 754 361792 467656 113954 4368 2 1 1582 2623 1869 789 569 2478 3661 4244 1862 70 789 17073 32116 23877 18190 9509 1862 1869 57276 111662 85466 57765 39766 18190 4244 2623 138376 252595 215620 157767 94947 57765 23877 3661 3164 3991 3332 111 6446 6104 554 0 45312 52375 6808 1 152058 189479 34694 761 361668 467812 113929 4360 3 1 1624 2560 1904 768 576 2464 3584 4384 1792 112 768 17136 32256 23632 18176 9600 1792 1904 57024 111872 85536 57856 39584 18176 4384 2560 138264 252672 215200 158208 95108 57856 23632 3584 3248 3994 3328 112 6416 6144 544 0 45424 52224 6848 0 151904 189696 34624 768 361544 467968 113904 4352 4
Attachments
polymake-input.tgz
(40 KiB) Downloaded 462 times

thelle
Posts: 3
Joined: 15 Jun 2011, 11:35

Re: polytope compute with 'INEQUALITIES' -> lattice points

Postby thelle » 22 Jun 2011, 12:22

That Code works. Now i can go on with the bigger matrices.

Thank You.

geeknick

Re: polytope compute with 'INEQUALITIES' -> lattice points

Postby geeknick » 14 Nov 2011, 06:29

i am getting lots of stuck from linear inequalities because i don't know that how to solve Inequalities ????

1. The problem statement, all variables and given/known data
Find the solution set of:

|x+1|+|x−2|≤5


2. Relevant equations

I'm going to rearrange this to

|x+1|≤5−|x−2|



3. The attempt at a solution

Well i sketched a graph of it. The line 5-|x-2| cross the y axis at 3 and it 'pongs' back of the x axis at -3 (is there a proper name for this value of x). The line |x+1| at cross y at 1 and x at -1.

The graph lines seem to cross between -3 and -1. One of them is a pongy line (reflected up from the x axis due to the modulus symbol) and the other is the original line.

5 - |x-2| = -|x+1|
|x-2| -5 = |x+1|

but how do i solve for that?

another concern i have is whether or the lines are going to cross again higher up (if you see what i mean). Is there a sound way of checking it.

Thanks in advance,
Nick

paffenholz
Developer
Posts: 212
Joined: 24 Dec 2010, 13:47

Re: polytope compute with 'INEQUALITIES' -> lattice points

Postby paffenholz » 15 Nov 2011, 13:17

1. The problem statement, all variables and given/known data
Find the solution set of:

|x+1|+|x−2|≤5
Probably you want to do some case distinctions here to get rid of the absolute values in your inequality.

However, this is the is the wrong place to aks this type of questions. The polymake forum aims at users and developers of the software system polymake. If you need more help with your problem please ask your question again at some more appropriate place, e.g. math.stackexchange (but read their guidelines first).


Return to “Helpdesk”