# write the rank function for “untangling line segments” problem

How to write a rank function in math for this problem?

Initially: there are 2n points on the Euclidean plane. The points are grouped in pairs with a line segment connecting each pair.

Action: the following untangling operation is repeatedly applied to the points.

Note that new pairs of crossed line segments may result from this operation.

Question: will this process terminate?

The process will terminate because we can choose 4 point randomly which two lines are tangling and then untangle them. the sum of line's length will decrease every untangle action. the sum of line's length will finally decrease to an unknown number and process terminated.

edit: untangling operation is choose four points that two lines are cross over, and then untangle them, so that the new lines aren't tangling. for example there are four points A, B, C, D that connect Line AB and CD as like "X". the untangle process rearrange the connecting points which create new line AC and BD, and they are not cross (untangle), it look like "||"

-
what untangling operation? – Bhargav Oct 5 '11 at 7:55
untangling operation is choose four points that two lines are cross over, and then untangle them, so that the new lines aren't tangling. for example there are four points A, B, C, D that connect Line AB and CD as like "X". the untangle process rearrange the connecting points which create new line AC and BD, and they are not cross (untangle), it look like "||" – Byron0324 Oct 5 '11 at 15:46
What is a rank function? – Mike Spivey Oct 5 '11 at 17:20