Git Product home page Git Product logo

pylkh's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pylkh's Issues

PermissionError: [Errno 13] Permission denied: 'C:\\Users\\...\\AppData\\Local\\Temp\\tmp4qz40njd'

Hi,

I am trying to use Python wrapper for LKH-3. But when I submit my .vrp file to the solver, I got the following error. I dont know how to solve it.

---------------------------------------------------------------------------
PermissionError                           Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_4328/1102774893.py in <module>
----> 1 lkh.solve(solver_path, problem=problem, runs=10, OUTPUT_TOUR_FILE="vrp_solution.csv")

~\Anaconda3\lib\site-packages\lkh\__init__.py in solve(solver, problem, **params)
     21 
     22     # need dimension of problem to parse solution
---> 23     problem = tsplib.load(params['problem_file'])
     24 
     25     if 'tour_file' not in params:

~\Anaconda3\lib\site-packages\tsplib95\loaders.py in load(filepath, problem_class, special)
     14     :rtype: :class:`~Problem`
     15     """
---> 16     with open(filepath) as f:
     17         return read(f, special=special, problem_class=problem_class)
     18 

PermissionError: [Errno 13] Permission denied: 'C:\\Users\\...\\AppData\\Local\\Temp\\tmp9p5slr0l'

Data of VRPTW

I encountered difficulties when dealing with data for solving VRPTW. IndexError: list index out of range for all VRPTW data

Cannot solve CVRP problem

hi, I installed this package and tried the example code, but the output seems to be a tsp result. Could you please help me out?

the example code is as follow:
'import requests
import lkh
problem_str = requests.get('http://vrp.atd-lab.inf.puc-rio.br/media/com_vrp/instances/A/A-n32-k5.vrp').text
problem = lkh.LKHProblem.parse(problem_str)
solver_path = r'/home/ubuntu/LKH_3/LKH-3.0.7/LKH'
print(lkh.solve(solver_path, problem=problem, max_trials=1000, runs=1, tour_file="./tour.txt"))'

the result is
[[1, 30, 19, 9, 10, 23, 16, 11, 26, 6, 21, 33, 27, 8, 14, 18, 20, 32, 22, 35, 7, 4, 3, 24, 5, 12, 29, 15, 34, 25, 28, 36, 13, 2, 17, 31]]

not like the README file. would you please check if some code was changed ? And how can I fix this.

Parsing error with m1_pdtsp/m_pdtsp problems

Hello,
trying to solve m-pdtsp( and m1_pdtsp) instances I run into the error: "ParsingError: IntegerField(CAPACITY): func transformer error: invalid literal for int() with base 10: '17\nDEMAND_" so it seems like it reads without recognizing the two lines capacity and demand dimension, it seems also that later it is also having the same parsing problem in the demand section. is m_pdtsp a kind of problem not supported? what should be done differently?

the instance used is:
NAME : m2n30Q17s777c1
TYPE : m-PDTSP
DIMENSION : 30
CAPACITY : 17
DEMAND_DIMENSION : 2
EDGE_WEIGHT_TYPE : EUC_2D
NODE_COORD_SECTION
1 0 0
2 -108 76
3 372 -432
4 -57 388
5 286 409
6 424 169
7 58 -497
8 221 118
9 470 380
10 -431 -422
11 305 -58
12 457 196
13 493 269
14 281 -259
15 -172 -484
16 263 -258
17 -427 153
18 351 314
19 478 120
20 -415 -203
21 20 -92
22 113 237
23 57 447
24 -322 -129
25 253 -27
26 -387 -243
27 -72 212
28 246 -337
29 71 279
30 351 -457
DEMAND_SECTION
1 0 0
2 4 0
3 0 5
4 -6 0
5 0 0
6 -5 0
7 0 -1
8 -1 0
9 0 -10
10 10 0
11 0 -9
12 -1 0
13 0 -3
14 4 0
15 0 8
16 -3 0
17 0 -2
18 3 0
19 0 -6
20 0 0
21 0 -4
22 1 0
23 0 8
24 -1 0
25 0 -5
26 3 0
27 0 9
28 0 0
29 0 10
30 -8 0
DEPOT_SECTION
1
-1
EOF

thank you in advance for any help given

Setting initial tour

Hi,

I'm wondering if it is possible to set a given tour as the initial tour of the solver (e.g., as the first seed) and if it is possible, how can I do that?

Thanks.

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.