Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

running error #14

Open
12345Mohamed opened this issue Jun 26, 2020 · 3 comments
Open

running error #14

12345Mohamed opened this issue Jun 26, 2020 · 3 comments

Comments

@12345Mohamed
Copy link

Dear Mr. Romulo

First of all, I would like to thank you for your prompt response and support.

Please note that I downloaded version 2.7 of the Python program and ran the program through the command line and still there is an issue, the attached result appeared in the email and I also added a copy of the program in the attachments because I modified the print command from print”” to print(“”) in all files because it was not working properly.

Please advise

Best Regards
Mohamed
command result

monte-carlo-cvrp-master_new.zip

@RomuloOliveira
Copy link
Owner

Hi, @12345Mohamed, sorry for the late response. Can you please post here the output for python --version command? Could you also try python2 --version?

Here's mine:

~/projects/monte-carlo-cvrp (master  ☂ )
 ⟩ python2 --version
Python 2.7.16

I couldn't reproduce the issue you're having. Are you using master branch code or a modified one?

Here's the steps I've ran:

~/projects
 ⟩ git clone [email protected]:RomuloOliveira/monte-carlo-cvrp.git
Cloning into 'monte-carlo-cvrp'...
cd remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 1126 (delta 0), reused 0 (delta 0), pack-reused 1123
Receiving objects: 100% (1126/1126), 233.39 KiB | 690.00 KiB/s, done.
Resolving deltas: 100% (611/611), done.
~/projects
 ⟩ cd monte-carlo-cvrp/
~/projects/monte-carlo-cvrp (master)
 ⟩ python2 run.py input/Augerat/A-n32-k5.vrp 5
{'COMMENT': '(Augerat et al, No of trucks: 5, Optimal value: 784)', 'CAPACITY': '100', 'NAME': 'A-n32-k5', 'EDGE_WEIGHT_TYPE': 'EUC_2D', 'TYPE': 'CVRP', 'DIMENSION': '32'}
ClarkeWrightSolver solution:
[13, 2, 17, 31]: 73
[22, 32, 20, 18, 14, 8, 27]: 155
[25, 7, 24, 4, 3]: 171
[28, 23, 10, 9, 12, 5, 29, 19, 15]: 241
[30, 16, 11, 26, 6, 21]: 194
Total cost: 834
Elapsed time (seconds): 0.122735977173

...

Note that it could take several minutes to run the complete script completely.

@RomuloOliveira
Copy link
Owner

Hi, @12345Mohamed, I was able to reproduce this error you had using Python3. I'll submit a code that will make this script compatible with Python3.

@RomuloOliveira
Copy link
Owner

@12345Mohamed can you please get the latest version from master and try again? This commit should fix your problem.

~/projects/monte-carlo-cvrp (master )
 ⟩ python3 run.py input/Example-k2.vrp 2
{'NAME': 'Example', 'COMMENT': '(http://web.mit.edu/urban_or_book/www/book/chapter6/6.4.12.html, two vehicles, Optimal value: 397)', 'TYPE': 'CVRP', 'DIMENSION': '10', 'EDGE_WEIGHT_TYPE': 'EXPLICIT', 'EDGE_WEIGHT_FORMAT': 'FULL_MATRIX', 'CAPACITY': '23'}
=== Starting ClarkeWrightSolver algorithm ===

ClarkeWrightSolver solution:
[5, 4, 3, 2]: 194
[8, 9, 10, 6, 7]: 203
Total cost: 397
Elapsed time (seconds): 0.002596139907836914

=== Finished ClarkeWrightSolver algorithm ===

=== Starting MonteCarloSavingsSolver algorithm ===

best solution found on 0.0090789794921875
average solution lengths: 419.28
MonteCarloSavingsSolver solution:
[5, 4, 2, 3]: 194
[8, 9, 10, 6, 7]: 203
Total cost: 397
Elapsed time (seconds): 0.37041687965393066

=== Finished MonteCarloSavingsSolver algorithm ===

=== Starting BinaryMCSCWSSolver algorithm ===

BinaryMCSCWSSolver solution:
[5, 4, 3, 2]: 194
[8, 9, 10, 6, 7]: 203
Total cost: 397
Elapsed time (seconds): 1.6933650970458984

=== Finished BinaryMCSCWSSolver algorithm ===

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants