1

Is there any algorithm or related work for the following problem?

Given a set of line segments in 2D, how to move line segments (horizontally or vertically) to eliminate intersections so as to minimize the overall movements? Intersections at endpoints can be allowed.

Mirian
  • 11
  • 1
  • How do you define minimal? The minimum number of movements or the minimum of the sum of distances/squares of the distances? – biziclop Mar 08 '11 at 23:49
  • Also, can you move line endpoints separately, or is the length and orientation of the lines const? – Jonas Bötel Mar 09 '11 at 01:00

1 Answers1

0

If you want to minimize the number of segment movements:

You can transform the line segment problem to a graph problem: Each segment is a vertex of the graph and there is an edge between two vertices if the two segments intersect each other. You want to find the minimum number of vertices that contain at least one endpoint of all the edges (because if you move all of these segments there will be no more intersections). This is the vertex cover problem, which is unfortunately NP hard, buth there exist approximation algorithms.

see: http://en.wikipedia.org/wiki/Vertex_cover_problem

Karoly Horvath
  • 94,607
  • 11
  • 117
  • 176