Coder Social home page Coder Social logo

routefinder's Introduction

RouteFinder

Multiple destination route finder using a combination of factorial combinations and genetic algorithm.

This application uses the functionality of uber python library and geocoder to get coordinates of user entered strings.

pip install uber_rides pip install geocoder

Try the above mentioned pip commands in case libraries are not present on your system.

Try running python RoutePlanners.py to run the updated program incorporating the functionality of certain hops order.

In case google can't verify the coordinates, try retyping the address. More often than not the coordinates get verified with the same string.

  1. Start with entering the pickup address
  2. Follow it up by entering the final destination address
  3. Enter the destination addresses the user intend to visit
  4. Adding * at the end of destination assigns it a priority, number of stars determine the hierarchy
  5. Entering y at any time will lead to the calculation of the best available route.
  6. Entering r in the console input will restart the program
  7. Entering "exit" will result in termination of the program
  8. Once the route calculation is completed and best available route is diplayed. The best route could be optimized by entering 'o' in the console

Here are some examples destinations that has been used during the testing of this program, -> liberty mall lahore -> badshahi moque lahore -> fortress stadium lahore -> university of engineering & Technology lahore -> emporium mall lahore -> sheesh mahal lahore -> shalimar gardens,Lahore -> allama iqbal international airport lahore -> avari hotel lahore -> mm alam road lahore -> allama iqbal road lahore

Implementation of prioritizing different destinations: Putting * at the end of an address makes that address a priority. Number of stars at the end of the address determines its importance. Two or more destinations having the same priority are permutated to calculate the optimum route.

Multithreading has been used to speed up the data collection using uber API. Two algorithms are coded to find the best routes. When the visiting non-prioritized destinations are less than or equal to 8, all permutations are checked to find the best route for the user to take. If destinations are more than 8, then a genetic algorithm is used to find the optimized route. A population is initially generated randomly and for each order in the population, fitness is calculated based on the fare of that route. Next generation is populated based on the fitness probability and given mutation aiding in finding a more optimized or cheaper route. Before the genetic algorithm is run in the updated version of file,a threaded function of brute force algorithm is made to run in the background to find the optimum route eventually.

I enjoyed working on this assignment and many thanks for the opportunity given to me. Best regards, Usman Sharif Khan

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.