I am using ArcGIS 10.3 for Desktop.
I have a shapefile with polylines connecting points. Instead of having one single polyline connecting two points, there exist a number of consecutive segments connected to each other (see image below).
These segments, however, have no field values in common, so if I wanted to use Dissolve to merge all of them together it would not work the way I expect.
Is there a way to assign a common field value to all the segments between two consecutive points? This way, Dissolve could be used effectively. I am open to any kind of solution, and would prefer a Python-based one, if available.
Visual example: all segments in between point A and point B should get a common field value, so that they can be later merged. This should apply to all segments in between any two points.
This question is not a duplicate of ArcGIS 10.3: How to merge lines divided by junction points?, which I myself have asked. Rather, this question is a precursor to it, if you like.
Screenshot of the real situation. Red dots are the equivalent of Points A and B, while the segments are recognizable by the junction points in green (there is a segment in between each pair of consecutive green dots). For each red dot, I want one single incoming and one single outgoing line.