Given some lengths, can we create a closed polygon with them?
What is the complexity of such algorithm if one exist?
E.g: Given 4, 4, 4, 4 we can build a square...
Geometry Problem...
Moderator: Board moderators
-
- Experienced poster
- Posts: 122
- Joined: Tue Apr 16, 2002 10:07 am
-
- Guru
- Posts: 584
- Joined: Thu Jun 19, 2003 3:48 am
- Location: Sanok, Poland
- Contact:
-
- New poster
- Posts: 10
- Joined: Fri Jun 10, 2005 5:30 pm
Yes, what Krzysztof said is right, you can always create it, if longest edge < sum of the other edges.
This was one of the problems of this years Baltic Olympiad of Informatics. One Solution to find such a polygon is to put all the points on a circle and do a binary search over the radius. You can then calculate the arc each edge takes in the circle and if they add up to 360 degrees, you found a solution.
Its always possible to put them on a circle, cause you can always create such a polygon with the above algorithm...
This was one of the problems of this years Baltic Olympiad of Informatics. One Solution to find such a polygon is to put all the points on a circle and do a binary search over the radius. You can then calculate the arc each edge takes in the circle and if they add up to 360 degrees, you found a solution.
Its always possible to put them on a circle, cause you can always create such a polygon with the above algorithm...
-
- Experienced poster
- Posts: 122
- Joined: Tue Apr 16, 2002 10:07 am
-
- New poster
- Posts: 10
- Joined: Fri Jun 10, 2005 5:30 pm
-
- A great helper
- Posts: 481
- Joined: Sun Jun 19, 2005 1:18 am
- Location: European Union (Slovak Republic)
-
- Experienced poster
- Posts: 122
- Joined: Tue Apr 16, 2002 10:07 am
-
- A great helper
- Posts: 481
- Joined: Sun Jun 19, 2005 1:18 am
- Location: European Union (Slovak Republic)