Git Product home page Git Product logo

Comments (3)

diogo-fernan avatar diogo-fernan commented on May 24, 2024

Hello there,

Can you elaborate more on that? The loops at https://github.com/diogo-fernan/aco/blob/master/src/ACO.cpp#L288-L293 and https://github.com/diogo-fernan/aco/blob/master/src/ACO.cpp#L167-L169 respectively iterate through all pheromone values and edges.

from aco.

divanshArora avatar divanshArora commented on May 24, 2024

Hi,

The array ROUTE is of length NUMCITIES. So for example, Say we have 3 cities and an ant found route 1->2->3 as feasible route. ROUTE will now be 1, 2, 3 https://github.com/diogo-fernan/aco/blob/master/src/ACO.cpp#L167 will iterate over indices 0 and 1 and add edge weight for edges 1->2 and 2->3 only. But afaik, we should also take the weight of edge 3->1 in consideration. Similarly, https://github.com/diogo-fernan/aco/blob/master/src/ACO.cpp#L281 will not update DELTAPHEROMONES for 3->1. This will be 0. What do you think?

from aco.

diogo-fernan avatar diogo-fernan commented on May 24, 2024

As far as I remember the algorithm finds an iterative solution to the shortest path between a starting point and destination. So, in your example, 3->1 would not make sense as it is an inverse path and goes back to the origin. Please see "Computational Intelligence: An Introduction" (first edition from 2002) by Andries Engelbrecht for more information as it provides the theory for the algorithm.

from aco.

Related Issues (3)

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.