Railway circuit: Difference between revisions

m
Line 607:
 
=={{header|Julia}}==
#=
<pre>
ExhaustiveExhautive search for complete railway (railroad track) circuits. A valid circuit begins and ends at the
same point facingfaciing in the same direction. Track are either right handed or left handed 30 degree
curves or are straight track that can be placed at -90, 0, or 90 degree angles from starting points.
 
Line 622 ⟶ 623:
So, the equivalence group is composed: (rotational permutations) X (scalar multiplication by -1)
 
There is another factor in equivalence groups not mentioned in the task as of June 2022: __vector<em>vector reversal__reversal</em>.
If __vectorvector reversal__reversal is included, (-1 1 -1 1 1 1 -1) is considered to group with (-1 1 1 1 -1 1 -1).
 
Furthermore, if chosen, reversal of the turns vector (not mentioned as a source of symmetry in the task)
Line 638 ⟶ 639:
Graphic displays of solutions are via a Gtk app and Cairo graphics.
</pre>
=#
<lang ruby>
""" Rosetta Code task rosettacode.org/wiki/Railway_circuit. """
 
Line 663 ⟶ 664:
 
""" Determine if vector `turns` is in an equivalence group with the vector `groupmember` """
function isinequivalencegroup(turns, groupmember, reversals = false)
for i in eachindex(turns)
groupmember == circshift(turns, i - 1) && return true
Line 670 ⟶ 671:
for i in eachindex(invturns)
groupmember == circshift(invturns, i - 1) && return true
end
if reversals
revturns = reverse(turns)
for i in eachindex(revturns)
groupmember == circshift(revturns, i - 1) && return true
end
invturns = -1 .* revturns
for i in eachindex(invturns)
groupmember == circshift(invturns, i - 1) && return true
end
end
return false
Line 714 ⟶ 725:
 
""" Returns true if the path of turns returns to starting point, and on that return is
moving in a direction equalopposite to (mod 2π) the starting direction.
"""
function isclosedpath(turns, straight, start = Point(0.0, 0.0))
Line 830 ⟶ 841:
end
 
for i = 12:4:322:36, rev in false:true, str in false:true
str && i > 16 && continue
@time allvalidcircuits(i; verbose = !str && i < 28, reversals = rev, straight = str, graphic = i == 24)
end
</lang>{{out}}
<pre>
For N of 4 and curved track, including reversed curves:
Found 0 unique valid circuits.
0.000907 seconds (70 allocations: 4.461 KiB)
 
For N of 4 and straight track, including reversed curves:
Found 1 unique valid circuits.
0.000675 seconds (209 allocations: 17.836 KiB)
 
For N of 4 and curved track, excluding reversed curves:
Found 0 unique valid circuits.
0.000737 seconds (68 allocations: 4.430 KiB)
 
For N of 4 and straight track, excluding reversed curves:
Found 1 unique valid circuits.
0.000724 seconds (218 allocations: 18.477 KiB)
 
For N of 6 and curved track, including reversed curves:
Found 0 unique valid circuits.
0.000748 seconds (165 allocations: 15.727 KiB)
 
For N of 6 and straight track, including reversed curves:
Found 1 unique valid circuits.
0.001228 seconds (1.51 k allocations: 162.398 KiB)
 
For N of 6 and curved track, excluding reversed curves:
Found 0 unique valid circuits.
0.000816 seconds (164 allocations: 15.430 KiB)
 
For N of 6 and straight track, excluding reversed curves:
Found 1 unique valid circuits.
0.001109 seconds (1.52 k allocations: 164.227 KiB)
 
For N of 8 and curved track, including reversed curves:
Found 0 unique valid circuits.
0.000728 seconds (548 allocations: 65.430 KiB)
 
For N of 8 and straight track, including reversed curves:
Found 7 unique valid circuits.
0.004763 seconds (13.64 k allocations: 1.665 MiB)
 
For N of 8 and curved track, excluding reversed curves:
Found 0 unique valid circuits.
0.000924 seconds (549 allocations: 65.727 KiB)
 
For N of 8 and straight track, excluding reversed curves:
Found 7 unique valid circuits.
0.003679 seconds (13.77 k allocations: 1.680 MiB)
 
For N of 10 and curved track, including reversed curves:
Found 0 unique valid circuits.
0.000959 seconds (2.08 k allocations: 289.430 KiB)
 
For N of 10 and straight track, including reversed curves:
Found 23 unique valid circuits.
0.044344 seconds (123.94 k allocations: 17.029 MiB, 33.72% gc time)
 
For N of 10 and curved track, excluding reversed curves:
Found 0 unique valid circuits.
0.001132 seconds (2.08 k allocations: 289.430 KiB)
 
For N of 10 and straight track, excluding reversed curves:
Found 15 unique valid circuits.
0.027965 seconds (121.00 k allocations: 16.624 MiB)
 
For N of 12 and curved track, including reversed curves:
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
Found 1 unique valid circuits.
0.004032 seconds (8.37 k allocations: 1.259 MiB)
 
For N of 12 and straight track, including reversed curves:
Found 141 unique valid circuits.
0.308568 seconds (1.31 M allocations: 200.564 MiB, 17.57% gc time)
 
For N of 12 and curved track, excluding reversed curves:
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
Found 1 unique valid circuits.
0.004644 seconds (8.39 k allocations: 1.262 MiB)
 
For N of 12 and straight track, excluding reversed curves:
Found 95 unique valid circuits.
0.235373 seconds (1.18 M allocations: 180.146 MiB, 13.06% gc time)
 
For N of 14 and curved track, including reversed curves:
Found 0 unique valid circuits.
0.005226 seconds (32.80 k allocations: 5.501 MiB)
 
For N of 14 and straight track, including reversed curves:
Found 871 unique valid circuits.
3.911026 seconds (20.58 M allocations: 3.374 GiB, 15.87% gc time)
 
For N of 14 and curved track, excluding reversed curves:
Found 0 unique valid circuits.
0.007905 seconds (32.80 k allocations: 5.501 MiB)
 
For N of 14 and straight track, excluding reversed curves:
Found 465 unique valid circuits.
2.412965 seconds (12.72 M allocations: 2.086 GiB, 14.93% gc time)
 
For N of 16 and curved track, including reversed curves:
[1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1]
Found 1 unique valid circuits.
0.013655 seconds (131.30 k allocations: 24.013 MiB)
 
For N of 16 and straight track, including reversed curves:
Found 6045 unique valid circuits.
75.173632 seconds (689.14 M allocations: 123.235 GiB, 22.65% gc time)
 
For N of 16 and curved track, excluding reversed curves:
[1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1]
Found 1 unique valid circuits.
0.015041 seconds (131.33 k allocations: 24.019 MiB)
 
For N of 16 and straight track, excluding reversed curves:
Found 3217 unique valid circuits.
48.776209 seconds (432.90 M allocations: 77.415 GiB, 21.55% gc time)
 
For N of 18 and curved track, including reversed curves:
[1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, -1]
Found 1 unique valid circuits.
0.108705 seconds (524.53 k allocations: 104.014 MiB, 10.93% gc time)
 
For N of 18 and curved track, excluding reversed curves:
[1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, -1]
Found 1 unique valid circuits.
0.098171 seconds (524.57 k allocations: 104.022 MiB, 14.81% gc time)
 
For N of 20 and curved track, including reversed curves:
Line 872 ⟶ 981:
[1, 1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, 1, 1, -1]
Found 6 unique valid circuits.
0.542609 seconds (2.10 M allocations: 448.222 MiB, 16.18% gc time)
 
For N of 20 and curved track, excluding reversed curves:
Line 881 ⟶ 991:
[1, 1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, 1, 1, -1]
Found 6 unique valid circuits.
0.524247 seconds (2.10 M allocations: 448.411 MiB, 17.80% gc time)
 
For N of 22 and curved track, including reversed curves:
[1, 1, 1, 1, 1, 1, 1, -1, -1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, -1, -1]
[1, 1, 1, 1, 1, 1, -1, -1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1]
[1, 1, 1, 1, 1, 1, -1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, -1, -1]
[1, 1, 1, 1, 1, -1, 1, 1, 1, -1, 1, 1, 1, -1, 1, 1, 1, 1, 1, -1, 1, -1]
[1, 1, 1, 1, 1, -1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1]
Found 5 unique valid circuits.
2.097615 seconds (8.39 M allocations: 1.875 GiB, 19.04% gc time)
 
For N of 22 and curved track, excluding reversed curves:
[1, 1, 1, 1, 1, 1, 1, -1, -1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, -1, -1]
[1, 1, 1, 1, 1, 1, -1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, -1, -1]
[1, 1, 1, 1, 1, -1, 1, 1, 1, -1, 1, 1, 1, -1, 1, 1, 1, 1, 1, -1, 1, -1]
[1, 1, 1, 1, 1, -1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1]
Found 4 unique valid circuits.
2.079754 seconds (8.39 M allocations: 1.875 GiB, 18.72% gc time)
 
For N of 24 and curved track, including reversed curves:
Line 924 ⟶ 1,052:
[1, 1, 1, -1, 1, 1, 1, -1, 1, 1, 1, -1, 1, 1, 1, -1, 1, 1, 1, -1, 1, 1, 1, -1]
Found 40 unique valid circuits.
8.816823 seconds (33.60 M allocations: 8.010 GiB, 18.48% gc time)
 
For N of 24 and curved track, excluding reversed curves:
Line 954 ⟶ 1,083:
[1, 1, 1, -1, 1, 1, 1, -1, 1, 1, 1, -1, 1, 1, 1, -1, 1, 1, 1, -1, 1, 1, 1, -1]
Found 27 unique valid circuits.
8.891642 seconds (33.73 M allocations: 8.016 GiB, 18.45% gc time, 1.16% compilation time)
 
For N of 26 and curved track, including reversed curves:
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1]
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, -1]
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1]
[1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, -1, 1, -1, -1]
[1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, -1, -1, -1]
[1, 1, 1, 1, 1, 1, 1, -1, -1, -1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, -1, -1, 1, 1, -1]
[1, 1, 1, 1, 1, 1, 1, -1, -1, -1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, -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1, 1, -1, 1, 1, -1, 1, 1, -1]
[1, 1, 1, 1, 1, -1, 1, 1, -1, 1, -1, 1, 1, 1, 1, -1, 1, 1, 1, 1, -1, 1, -1, 1, 1, -1]
[1, 1, 1, 1, 1, -1, 1, -1, 1, 1, 1, 1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, 1, 1, -1, -1]
[1, 1, 1, 1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, 1, -1, 1, 1, -1, 1, 1, 1, 1, -1, 1, -1]
[1, 1, 1, 1, 1, -1, 1, -1, 1, 1, 1, -1, 1, 1, 1, -1, 1, 1, 1, -1, 1, 1, 1, -1, 1, -1]
[1, 1, 1, 1, 1, -1, 1, 1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, 1, -1]
[1, 1, 1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, 1, -1]
[1, 1, 1, 1, 1, -1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, 1, 1, 1, -1, 1, 1, 1, 1, -1, -1]
[1, 1, 1, 1, 1, -1, 1, 1, 1, -1, -1, 1, 1, 1, 1, 1, -1, 1, 1, -1, 1, 1, 1, 1, -1, -1]
[1, 1, 1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, 1, 1, 1, 1, -1, -1]
[1, 1, 1, 1, 1, -1, 1, 1, -1, 1, 1, 1, -1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, 1, -1, -1]
[1, 1, 1, 1, -1, 1, 1, -1, 1, 1, 1, -1, 1, 1, 1, -1, 1, 1, -1, 1, 1, 1, 1, -1, 1, -1]
[1, 1, 1, 1, -1, 1, 1, -1, 1, 1, 1, -1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, 1, 1, -1]
Found 58 unique valid circuits.
36.909355 seconds (134.32 M allocations: 34.024 GiB, 18.53% gc time, 0.04% compilation time)
 
For N of 26 and curved track, excluding reversed curves:
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1]
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1]
[1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, -1, -1, -1]
[1, 1, 1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, -1, -1, -1]
[1, 1, 1, 1, 1, 1, 1, -1, 1, -1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, -1, -1, -1]
[1, 1, 1, 1, 1, 1, 1, -1, 1, -1, -1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, -1, -1, 1, -1]
[1, 1, 1, 1, 1, 1, 1, -1, 1, -1, -1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1]
[1, 1, 1, 1, 1, 1, 1, -1, -1, 1, 1, 1, 1, 1, -1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1]
[1, 1, 1, 1, 1, 1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, -1, 1, 1, 1, 1, 1, 1, -1, -1, -1]
[1, 1, 1, 1, 1, 1, 1, -1, -1, 1, 1, 1, -1, 1, 1, 1, -1, 1, 1, 1, 1, 1, -1, 1, -1, -1]
[1, 1, 1, 1, 1, 1, 1, -1, -1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1]
[1, 1, 1, 1, 1, 1, -1, 1, 1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, -1, 1, -1, -1]
[1, 1, 1, 1, 1, 1, -1, 1, 1, -1, 1, 1, 1, -1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, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, 1, -1, -1]
[1, 1, 1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, 1, 1, 1, -1, -1, 1, 1, 1, 1, 1, -1, -1]
[1, 1, 1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, 1, 1, 1, 1, -1, -1]
[1, 1, 1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, 1, -1]
[1, 1, 1, 1, 1, -1, 1, 1, -1, 1, -1, 1, 1, 1, 1, -1, 1, 1, 1, 1, -1, 1, -1, 1, 1, -1]
[1, 1, 1, 1, 1, -1, 1, -1, 1, 1, 1, 1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, 1, 1, -1, -1]
[1, 1, 1, 1, 1, -1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, 1, 1, 1, -1, 1, 1, 1, 1, -1, -1]
[1, 1, 1, 1, 1, -1, 1, -1, 1, 1, 1, -1, 1, 1, 1, -1, 1, 1, 1, -1, 1, 1, 1, -1, 1, -1]
[1, 1, 1, 1, -1, 1, 1, -1, 1, 1, 1, -1, 1, 1, 1, -1, 1, 1, -1, 1, 1, 1, 1, -1, 1, -1]
[1, 1, 1, 1, -1, 1, 1, -1, 1, 1, 1, -1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, 1, 1, -1]
Found 35 unique valid circuits.
36.537159 seconds (134.29 M allocations: 34.017 GiB, 18.66% gc time)
 
For N of 28 and curved track, including reversed curves:
Found 293 unique valid circuits.
152.393778 seconds (539.33 M allocations: 144.659 GiB, 18.92% gc time)
 
For N of 28 and curved track, excluding reversed curves:
Found 174 unique valid circuits.
153.737110 seconds (538.62 M allocations: 144.470 GiB, 18.69% gc time)
 
For N of 32 and curved track, including reversed curves:
Found 2793 unique valid circuits.
 
For N of 32 and curved track, excluding reversed curves:
Found 1485 unique valid circuits.
</pre>
 
4,105

edits