shortest path algorithm on a squared pattern - Barcelona Eixample @m0rt0n90
shortest path algorithm on a squared pattern - Barcelona Eixample  @m0rt0n90
Uploaded October 2016 | Updated November 2026, 2 days ago
Demonstration of the shortest path - starting from the middle of a planned city, ending at the starting point without taking one path twice.

The number of encircled blocks can be calculated:
B = 1 + 4 * SUM n
--- n = 0 means, you have walked round B = 1 + 4*0 = 1 block;
--- n = 1 means, you have walked round B = 1 + 4*0 + 4*1 = 5 blocks;
...

The number of stretches of roads can be calculated:
S = 4 * SUM 2*n+1
--- n = 0 means, you have walked along S = 4*2*0+4*1 = 4 stretches of roads;
--- n = 1 means, you have walked along S = 4*2*0+4*1 + 4*2*1+4*1 = 16 stretches of roads
...

If you walk through Barcelona Eixample as seen in the animation (hint: this is only one possible, but highly symmetrical circuiting solution), you can set "n" to 3 and you will have walked round 25 blocks and along 64 stretches of roads, this means 64 * 133.3m ~ 8500m

For n = 10 the travelled distance would be 484 * 133.3m ~ 65km

If you prefer to walk rather in one direction (and not circular) or you want to be able to change your amount of blocks discrete, other solutions might more suitable to you.

For further information visit
en.wikipedia.org/wiki/Eulerian_path
en.wikipedia.org/wiki/Eixample

literature [german]
Graphen für Einsteiger
"Rund um das Haus vom Nikolaus", author: Nitzsche, Manfred, ISBN 978-3-8348-9968-2

animated GIF
gif-erstellen.com/g/sj3grl4x
shortest path algorithm on a squared pattern - Barcelona Eixample2015-06-01_Experiment_04_Astigmatismus2015-03-02_Experiment_03_Kondensator2015-05-04_Experiment_02_Wasserwelle2015-03-03_Experiment_04_Koaxialkabel-Feldlinien2015-06-02_Experiment_07_Michelson-Interferometer-Erklaerung2015-01-20_Experiment_04_FederpendelYou are not safe [outtakes]2015-03-24_Experiment_03_ferromagnetische-Probe2015-10-15_Experiment_01_2D-Welt2015-10-28_Experiment_03_Mach-Zehnder-Interferometer2015-04-22_Experiment_01_hochfrequente-stehende-Welle
Martin Mairhofer |

shortest path algorithm on a squared pattern - Barcelona Eixample

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER