Giter Site home page Giter Site logo

Comments (7)

jcoupey avatar jcoupey commented on July 21, 2024

@frodrigo: Thanks for pointing this out.

I've been paying closer attention to memory while solving big TSPLIB instances. On my laptop the load starts to be significant around 10000 locations. usa13509.tsp is still ok but all bigger instances fail...

The heuristic phase gives a peek for memory usage due to this, a sub-matrix is actually copied from the existing matrix...

from vroom.

frodrigo avatar frodrigo commented on July 21, 2024

So, maybe the first step is avoiding to instantiate submatrix by create a virtual matrix using index to access original matrix data.

from vroom.

jcoupey avatar jcoupey commented on July 21, 2024

After copy, the sub_matrix is actually modified before being passed to minimum_weight_perfect_matching. So I should check on the best way to do this without breaking the original matrix.

This is not actually a problem with your approach as only a part of the locations vector would be copied.

from vroom.

jcoupey avatar jcoupey commented on July 21, 2024

I removed the initial matrix implementation and replaced it by the one you suggested (this is the only one required in this branch anyway). I removed everything that stood in the way for compilation (e.g. other loaders, forced start and stop options).

Still segfaults due to matrix copies, I hope to fix this by merging some commits from the refactor_tsp_structure branch.

from vroom.

jcoupey avatar jcoupey commented on July 21, 2024

@frodrigo Using current HEAD of the experimental_huge_instances branch, I've been able to solve bigger instances, e.g. pla33810 from TSPLIB. Limitations are:

from vroom.

frodrigo avatar frodrigo commented on July 21, 2024

Interesting ! Thank for looking at this.
How close are you of know solution of pla33810 in 10 hours ?
The bad part, here, is the amount of memory required. Do you think the edge class and the storage of all the weight can be removed ? The spanning tree can be done on square distance without computing the square root. For the rest, I 'm not what between compute distance on the fly or storing on spare matrix can be efficient.

from vroom.

jcoupey avatar jcoupey commented on July 21, 2024

The solution for pla33810 costs 68133433, which is +3.16% from optimal. As the benchmark results points out so far, the size of the instances does not really impact on the current approach's performance in term of distance to optimal.
The results for other big instances in TSPLIB are quite in line with that: rl11849, usa13509, brd14051, d15112 and d18512 are at +2.96% , +2.88%, +3.18%, +2.93% and +2.94% from the respective optimal solutions.

Reducing the memory by not storing the edges (at least for the complete graph) would be the next step. This might be a little more tricky than with the matrix as the undirected_graph is used differently depending on the context (with edges or with an adjacency list).

from vroom.

Related Issues (20)

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.