Remove concept of alternating layers
Remove concept of alternating layers

I've just realized that ESK's concept of an alternating layer doesn't
really serve any useful purpose, at least in this implementation.

In their paper, ESK use alternating layers to ensure that p nodes
always have an adjacent container to be absorbed into in Step 1. This
appears to be their only use. Empty containers are unpositioned in
Step 2, and have no effect on the ordering of the next layer in Step
3, at which point they effectively disappear from the algorithm.

Further, the most natural way of incorporating p nodes into segment
containers - mapping p nodes to segment containers and then reducing
the resulting list by joining consecutive containers - does not rely
on the alternating property of the layer to work. This makes it easy
to remove.

It also has the following benefits:
- shorter ordered lists result in a smaller n for several sub-
  algorithms,
    - setting positions, O(n)
    - setting measures, O(predecessors of n)
    - ordering next layer O(nodes + len(segments) + log nodes + log
      segments)
    - adding q nodes O(n)
    - especially cross counting, O(edges log n_small)
- We get to remove Step 6 entirely
- It just seems more intuitive that a layer ordering algorithm would
  produce an ordering without extraneous stuff

bhagany/fatlip