What is the length of the longest straight path on the surface of a unit cube, such that it starts and ends at the same point?

The path can cross itself and must be straight on every edge and face that it passes.

  • 2
    $\begingroup$ Added more information $\endgroup$ Dec 26, 2023 at 7:05
  • 2
    $\begingroup$ By "straight on every edge" do you mean that if the cube were unfolded so the two adjoining faces are coplanar, then the line would be straight? $\endgroup$ Dec 26, 2023 at 10:08
  • 3
    $\begingroup$ Surely there are such paths of arbitrarily high length? $\endgroup$
    – xnor
    Dec 26, 2023 at 10:47
  • 7
    $\begingroup$ If you allow intersections, then you can wind around 4 faces arbitrarily many times like a spool of sewing thread before it hits one of the two other faces and cuts across to the first winding. $\endgroup$ Dec 26, 2023 at 12:37
  • 2
    $\begingroup$ @WeatherVane Trivial solution, two edges and two diagonals is $2+2\sqrt 2$ $\endgroup$
    – z100
    Dec 26, 2023 at 18:32

1 Answer 1


I believe the maximum length is



You can start from the center of an edge, cross an adjacent edge, then go 4N+1 times over the opposite edge and arrange to end on the middle of the edge adjacent to the last edge you crossed.
This resuls in winding the line N 1/2 times around 4 faces of the cube, starting and ending in the middle of opposite edges. Continuing straight you wind again N times around the cube over a different set of 4 edges and end up where you started.
This forms a perfectly straight loop.
Since N is arbitrary you can make it as long as you want.

PS: I did not read the comment before posing. Other got the same idea.

Now with the restriction that the line should not intersect:

Apply the method with N=0. The total length is $2 \sqrt{5} = 4.4721$

enter image description here

If vertices are allowed, I would draw a zig-zag over 4 diagonals around the cube for a length of $4 \sqrt{2} = 5.6568$

It can be unfolded to yield a straight line:
![enter image description here

  • 3
    $\begingroup$ The last diagram for four supposed diagonals is a bit off. The line isn't really straight. You can't go four diagonals, but you can go two diagonals and two edges, as commented by @z100 $\endgroup$ Dec 26, 2023 at 22:26
  • $\begingroup$ As you said, it's a "zig-zag". That diagram can only be made by cutting a face diagonally. $\endgroup$ Dec 26, 2023 at 22:46
  • $\begingroup$ @WeatherVane I don't understand the objection. These are true diagonals that go from vertex to vertex. They are obviously perfectly aligned. Do you complain about the image quality? And I don't see why cutting a face diagonally to unfold should be a problem. $\endgroup$
    – Florian F
    Dec 27, 2023 at 0:03
  • 2
    $\begingroup$ @FlorianF I think it's about the definition of "straightness", which is pretty clear when passing the edge, but no so clear when passing the vertex, depended on the way of flattening the cube net. $\endgroup$
    – z100
    Dec 27, 2023 at 9:57
  • 1
    $\begingroup$ I would completely disallow going along an edge or through a vertex as it leads to too much ambiguity about straight lines. For example you could argue that two edges meeting at a vertex are in a straight line because you can unfold the cube so that they are. That leads to the possible answer of a length 8 loop, a Hamilton path visiting all vertices. If you disallow vertices you could still go infinitessimally close to them and have the same effect, but it would reject the diagonals solution here because the loop would have to slalom between the four vertices and that is not straight. $\endgroup$ Dec 27, 2023 at 10:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.