Last active
December 18, 2015 12:19
-
-
Save aGHz/5781787 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A and Z are collections of closed segments defined by their 1-d endpoints. | |
Each is sorted according to the start position of the segment. | |
Place these segments on a line according to the following constraints: | |
- segments from Z must absolutely retain their position. | |
- if a segment from A starts before a segment from Z but overlaps with it, | |
split it in two. The part before the segment in Z retains its position, and | |
the second part comes after the segment from Z. This can happen multiple | |
times as needed. | |
- if a segment from A overlaps with a segment from Z but doesn't start | |
before, simply move it after the segment from Z. | |
- if two segments from A overlap, move the second one to come right after | |
the first. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment