Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Traversing the Montréal Métro with Python

Traversing the Montréal Métro with Python

I rode the entire Montréal Métro in 172 minutes. I'm not sure how helpful these slides will be, but they may help you relive some of my favorite jokes. The source code is at https://github.com/leafstorm/montreal-metro, and you can find a log of my journey at http://goo.gl/2nerjm. (It has lots of notes!)

Matthew Frazier

April 11, 2014
Tweet

More Decks by Matthew Frazier

Other Decks in Technology

Transcript

  1. Traversing the
    Montréal Métro
    with Python
    Matthew Frazier / @LeafStorm
    April 11, 2014

    View full-size slide

  2. NYC Subway Challenge
    World
    Record:
    26h21m08s

    View full-size slide

  3. Washington DC?

    View full-size slide

  4. My Program
    github.com
    /leafstorm
    /montreal-metro

    View full-size slide

  5. My Métro Text File
    Yellow Frequency 5
    Yellow Berri-UQAM Longueil 5
    Orange Frequency 4
    Orange Côte-Vertu Snowdon 8
    Orange Snowdon Lionel-Groulx 7
    Orange Lionel-Groulx Berri-UQAM 9
    Orange Berri-UQAM Jean-Talon 8
    Orange Jean-Talon Montmorency 12

    View full-size slide

  6. My Métro Graph

    View full-size slide

  7. Algorithms
    ● Minimum spanning tree
    ● Eulerian path
    ● Travelling salesman problem
    ● BRUTE FORCE!!!

    View full-size slide

  8. One of Eight Paths
    In 168 minutes:
    [ 0m + 10m] Ride from Angrignon to Lionel-Groulx on Green (direction Honoré-Beaugrand)
    [ 10m + 9m] Ride from Lionel-Groulx to Berri-UQAM on Green (direction Honoré-Beaugrand)
    [ 19m + 5m] Transfer at Berri-UQAM to Yellow (direction Longueil)
    [ 24m + 5m] Ride from Berri-UQAM to Longueil on Yellow (direction Longueil)
    [ 29m + 5m] Turn around at Longueil on Yellow (direction Berri-UQAM)
    [ 34m + 5m] Ride from Longueil to Berri-UQAM on Yellow (direction Berri-UQAM)
    [ 39m + 4m] Transfer at Berri-UQAM to Orange (direction Montmorency)
    [ 43m + 8m] Ride from Berri-UQAM to Jean-Talon on Orange (direction Montmorency)
    [ 51m + 12m] Ride from Jean-Talon to Montmorency on Orange (direction Montmorency)
    [ 63m + 4m] Turn around at Montmorency on Orange (direction Côte-Vertu)
    [ 67m + 12m] Ride from Montmorency to Jean-Talon on Orange (direction Côte-Vertu)
    [ 79m + 5m] Transfer at Jean-Talon to Blue (direction Saint-Michel)
    [ 84m + 5m] Ride from Jean-Talon to Saint-Michel on Blue (direction Saint-Michel)
    [ 89m + 5m] Turn around at Saint-Michel on Blue (direction Snowdon)
    [ 94m + 5m] Ride from Saint-Michel to Jean-Talon on Blue (direction Snowdon)
    [ 99m + 9m] Ride from Jean-Talon to Snowdon on Blue (direction Snowdon)
    [108m + 4m] Transfer at Snowdon to Orange (direction Côte-Vertu)
    [112m + 8m] Ride from Snowdon to Côte-Vertu on Orange (direction Côte-Vertu)
    [120m + 4m] Turn around at Côte-Vertu on Orange (direction Montmorency)
    [124m + 8m] Ride from Côte-Vertu to Snowdon on Orange (direction Montmorency)
    [132m + 7m] Ride from Snowdon to Lionel-Groulx on Orange (direction Montmorency)
    [139m + 9m] Ride from Lionel-Groulx to Berri-UQAM on Orange (direction Montmorency)
    [148m + 5m] Transfer at Berri-UQAM to Green (direction Honoré-Beaugrand)
    [153m + 15m] Ride from Berri-UQAM to Honoré-Beaugrand on Green (direction Honoré-Beaugrand)

    View full-size slide

  9. Angrignon - 16h21

    View full-size slide

  10. Honoré-Beaugrand - 17h13

    View full-size slide

  11. The World Record
    172 minutes

    View full-size slide

  12. Merci
    Matthew Frazier
    @LeafStorm
    github.com
    /leafstorm
    /montreal-metro
    Special thanks:
    Anton Dubrau
    CBSA/ASFC

    View full-size slide