Ask Your Question
0

Intersection of a hyperplane with a polytope (intersection in 9D)

asked 2013-02-21 17:27:14 -0500

assadabbasi gravatar image

updated 2013-02-22 00:41:49 -0500

Hi,

I have a hyperplane given by equation:

2/3x1 + 2/3x2 + 2/3x3 - 1/3x4 - 1/3x5 - 1/3x6 - 1/3x7 -1/3x8 - 1/3*x9 = 1

and a polytope with nine vertices:

P = [[0, 0, 0, 0, 0, 0, 0, 0, 0], [-8/9, 1/9, 1/9, 1/9, 1/9, 1/9, 1/9, 1/9, 1/9], [-7/9, -7/9, 2/9, 2/9, 2/9, 2/9, 2/9, 2/9, 2/9], [-2/3, -2/3, -2/3, 1/3, 1/3, 1/3, 1/3, 1/3, 1/3], [-5/9, -5/9, -5/9, -5/9, 4/9, 4/9, 4/9, 4/9, 4/9], [-4/9, -4/9, -4/9, -4/9, -4/9, 5/9, 5/9, 5/9, 5/9], [-1/3, -1/3, -1/3, -1/3, -1/3, -1/3, 2/3, 2/3, 2/3], [-2/9, -2/9, -2/9, -2/9, -2/9, -2/9, -2/9, 7/9, 7/9], [-1/9, -1/9, -1/9, -1/9, -1/9, -1/9, -1/9, -1/9, 8/9]]

Each vertex in this polytope is connected to other eight vertices with a line.

I have tried with the following approach but I am unable to get the correct result.

First I created a polyhedron from the equation of the hyperplane as follows:

Hplane1 = Polyhedron(eqns=[(-3,2,2,2,-1,-1,-1,-1,-1,-1)])

Next I used this code to find the intersection between hyperplane and the line connected by every two vertices of the Polytope 'P'

for j in range(len(P)):

 for i in range(len(P)):

     if i != j:

         a = Polyhedron( vertices = [P[i], P[j]])

         b = a.intersection(Hplane1)     

         print(b)

I know the this hyperplane and the polytope have some intersection points but I am unable to calculate them. Any help/suggestion will be highly appreciated.

Thanks

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2013-02-22 12:06:52 -0500

lftabera gravatar image

You can compute directly the intersection of the hyperplane and the polyhedron

sage: Hplane1 = Polyhedron(eqns=[(-3,2,2,2,-1,-1,-1,-1,-1,-1)])
sage: P = [[0, 0, 0, 0, 0, 0, 0, 0, 0], [-8/9, 1/9, 1/9, 1/9, ...
sage: P1 = Polyhedron(P)
sage: P1.intersection(Hplane1)
The empty polyhedron in QQ^9

So it looks that the hyperplane does not intersect your polyhedron.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2013-02-21 17:27:14 -0500

Seen: 545 times

Last updated: Feb 22 '13