Giter Club home page Giter Club logo

shivam141296 / vehicular-route-optimisation Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 210 KB

This app calculate the optimized route between multiple locations added by user on google maps. stating position and ending position remains same. It gives you a optimized sequence of places to travel so that all places could be covered in minimum distance exactly once. This project is sub part of my another project Carbon Footprint Calculator.

Java 100.00%
simmulated-annealing genetic-algorithm hill-climbing maps route-optimization route-planner travelling-salesman-problem api

vehicular-route-optimisation's Introduction

Vehicular-Route-Optimisation

For finding the optimal route between the given routes a genetic algorithm, hill climber algorithm and the simulated annealing algorithm is used.

Simulated Annealing Implementation-

C=C(initial)--------------------- Intial Random path For T maximum to T minimum (slowly cooling)

T stands for Temperature

Epoch:

E1=E(C)------- Path Length for Current Path

N=next(C)------- Next Path

E2=E(N)-------- Path Length of Next Path

Change in Energy of Configuration(X) = E2-E1

if(X>0) C=N

else if( e^(X/T) > rand(0,1) ) C=N; --- bad path condition

Hill Climbing Implementaion-

If we remove bad path condition,it will result in Hill Climbing. It is greedy appraoch so only looks for good path.

C=C(initial)--------------------- Intial Random path

For T maximum to T minimum (slowly cooling) ----- T stands for Temperature

Epoch:

E1=E(C)------- Path Length for Current Path

N=next(C)------- Next Path

E2=E(N)-------- Path Length of Next Path

Change in Energy of Configuration(X) = E2-E1

if(X>0) C=N

Genetic Algorithm Implementaion-

Chromosome represents a path in genetic algorithm.To create path shuffling is used.One such technique is for every city create n-1 random nos are generated,each random no for other n-1 city. Then sort cities according to the random no.By doing this you will get a new sequence.Repeat this process to generate required no(k) of chromosomes.You can also use normal shuffling to generate chromosomes(paths).

Crossover-

One such technique for crossover is choose cities in parent one you want to crossover and then remove cities you chose in parent one from other parent and place the removed cities in the end to get the first offspring. Simmilary repeat the process for second parent to get second offspring.

Mutation-

Mutation can be done by choosing cities in parent one and simply reversing the city order in parent two to get a valid offspring.Another method is choosing city in parent one and simply shifting the same city order to different location.

Recap: Lets say we have 50 chromosomes initially.From this generate 32 chromosomes through crossover,14 chromosomes through mutation,introduce 4 random chromosome to infuse new kind of thing. From all this total 100 chromosomes pick best chromosomes(least distance). Then update the iteration counter. If iteration counter<threshold repeat the process. If not, we have found present best solution.

vehicular-route-optimisation's People

Contributors

shivam141296 avatar

Stargazers

 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.