For context, this problem is part of my attempt to determine the path of least inertia for a free and open-source laser scanner DAC API I am developing. The following problem arises during the vector image optimisation pass. I convert the 2D vector image into a graph of 2D positions and add blank edges (i.e. transparent lines) to represent the image as a strongly connected, undirected Eulerian graph from which I should be able to determine the optimal Eulerian circuit.


Given a strongly connected, undirected Eulerian graph (i.e. each vertex has an even degree), I'm trying to determine the Eulerian circuit that results in the minimum possible accumulative angle, where each vertex is a position in 2D space and each edge describes a straight line between the vertices.

My Solution Attempt

My attempt at solving this was to first simplify the problem by looking at each vertex individually. We know that each vertex must have an even degree, and thus for each vertex there must be an optimal set of incoming/outgoing edge pairs (where each edge is used once) that results in a minimum accumulative angular distance. By minimum accumulative angular distance, I'm referring to the sum of the difference between the result of the difference between the angle of each incoming/outgoing edge pair and a straight line. For example, given the following vertex A and its neighbours B, C, D and E:

enter image description here

an example of optimal pairs would be (DA, AB) and (EA, AC) as they are cumulatively the least sharp angles through which A may be traversed (and in turn would induce the least inertia), whereas the pairs (EA, AD) and (BA, AC) would be the least optimal as cumulatively they contain the sharpest angles to be traversed (resulting in the highest inertia).

Once the set of optimal pairs is determined for each vertex, I suspect the Eulerian Circuit can be created by starting at one of the vertices, picking a direction to begin and following the optimal pairs until the beginning is reached again.

My Solution Attempt Issues

Currently however I'm running into two issues.

  1. I don't know for sure whether or not my assumption holds true for all Euler graphs (where all nodes have an even degree).
  2. I'm unsure of the best approach for determining the set of optimal edge pairs for each vertex. I suspect it may be possible to represent each vertex and its edges as a sub-graph and treat the problem as finding the shortest path (where the "shorter" distances are the paths through the vertex that result in the straightest angles), but I'm struggling to come up with a sub-graph representation that would allow me to do this.

Related Research

In section 3.4 of Accurate and Efficient Drawing Method for Laser Projection the paper describes using Hierholzer’s algorithm for finding an optimal Eulerian circuit with the amendment that during traversal of each vertex you select the unvisited edge along the angle closest to a straight line. One issue that occurs to me with this approach is that it is not clear to me that this always results in the absolute optimal circuit, only one that is probably more optimal than a naive construction without this added amendment.


  1. Is there an existing solution to the original Problem stated above? If so, is there somewhere I might read further on this?
  2. If not, does my attempted solution sound like a reasonable approach? If so, do you have an idea of how I might represent the sub-graph for determining the set of edge pairs resulting in the minimum accumulative angular distance for each vertex?
  3. If not, can you recommend an approach I might be able to take to make progress on solving the previously mentioned Problem?

Any advice appreciated!

  • $\begingroup$ Are the graphs planar i.e., no crossing edges? $\endgroup$
    – Mike
    Apr 16, 2019 at 15:38
  • $\begingroup$ The graphs may have crossing edges, e.g. the pentagram star (where only the points of the star are vertices) comes to mind as a valid graph in this case. Out of curiosity, is there a part of this problem you have in mind that this property might affect? $\endgroup$
    – mindTree
    Apr 16, 2019 at 15:55
  • $\begingroup$ I am not positive either way if planarity affects anything or not. A lot of things w graph algorithms do tend to be easier if the restriction is to planar graphs $\endgroup$
    – Mike
    Apr 16, 2019 at 16:01
  • 1
    $\begingroup$ This is a good question @mindTree, I'll think about this some more. This seems to be a research-level question whereas most of the questions/answers are for homework-level math problems [it is quite welcome here, I just don't know how likely it is that you'd get an answer]. Meanwhile you may have luck asking this question on MathOverflow, which is dedicated to questions such as these. $\endgroup$
    – Mike
    Apr 16, 2019 at 21:13
  • 2


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.