Partitioning a segmented stick
I'm not sure if I understand the problem specification correctly, but the problem looks a special case of the paint shop problem.  In that context, there is an NP-hardness result.

The main reference is: P. Bonsma, Th. Epping, and W. W. Hochstättler, Complexity results on restricted instances of a paint shop problem for words.  Discrete Applied Mathematics 154 (2006) 1335-1343.  http://dx.doi.org/10.1016/j.dam.2005.05.033

The abstract says as follows.


  We study the following problem: an instance is a word with every letter occurring twice. A solution is a 2-coloring of its letters such that the two occurrences of every letter are colored with different colors. The goal is to minimize the number of color changes between adjacent letters.
  
  This is a special case of the paint shop problem for words, which was previously shown to be NP-complete. We show that this special case is also NP-complete and even APX-hard. Furthermore, derive lower bounds for this problem and discuss a transformation into matroid theory enabling us to solve some specific instances within polynomial time.