Giter VIP home page Giter VIP logo

puputfts / python---public-transport-shortest-path-dijsktra-and-hamilton-cycle-search Goto Github PK

View Code? Open in Web Editor NEW

This project forked from michzio/python---public-transport-shortest-path-dijsktra-and-hamilton-cycle-search

0.0 1.0 0.0 296 KB

This is program that uses Dijkstra algorithm in order to find shortest connection in public transport network implemented as directed graph with time as edges weight. Program also enable to find Hamilton cycle resolving "Travelling salesman problem" using Simulated annealing algorithm.

C++ 56.02% Python 43.98%

python---public-transport-shortest-path-dijsktra-and-hamilton-cycle-search's Introduction

Python---Public-Transport-Shortest-Path-Dijsktra-and-Hamilton-Cycle-Search

This is program that uses Dijkstra algorithm in order to find shortest connection in public transport network implemented as directed graph with time as edges weight. Program also enable to find Hamilton cycle resolving "Travelling salesman problem" using Simulated annealing algorithm.

Problem Definition:

  1. There is graph (V,E)
  2. Nodes in this graph represents public transport stops, while edges represent bus (or tram) connections between them.
  3. Edges has weights that represents travel time between stops.
  4. Task has two parts: a) client types two stops and the algorithm have to find the shortest path (connection) taking into account travel time (edges weights) - this is Dijkstra algorithm b) client types list of stops and the algorithm have to find shortest cycle visiting each stop on the list. If it is possible each stop should be visited only once. - this is hamilton cycle for graph constructed from typed stops list (travelling salesman problem), if there isn't hamilton cycle we allow for repeating vertices in cycle. This problem will be solved by generating possible vertices permutation that represents cycle and use heuristic algorithm -> Simulated annealing.
  5. INPUT:
, , , , ..., ... , , , ...,
  1. EXAMPLE INPUT: 5 18 Czerwone_Maki, 2, Chmieleniec, 1, Kampus_UJ, 2, ..., 3, Krowodrza Górka ... 164 Piaski_Nowe, 2, Nowosądecka, 1, ..., 2, Górka Narodowa

  2. EXAMPLE OUTPUT - PROBLEM 1: Type starting stop: Kampus_UJ Type ending stop: Teatr_Bagatela Shortest connection: Kampus_UJ, Ruczaj, Norymberska, ..., Filharmonia, Teatr_Bagatela (travel time 30) 52 → 11 → 18

  3. EXAMPLE OUTPUT - PROBLEM 2: Type number of stops to visit: 5 Type name of 1st stop: Kampus_UJ ... Type name of 5th stop: Teatr_Bagatela Shortest cycle visiting each stop: Kampus_UJ, ..., Kampus_UJ 52 → 11 → 18 → 11 → 52

python---public-transport-shortest-path-dijsktra-and-hamilton-cycle-search's People

Contributors

michzio avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.