NeverOnTimeSdnBhd / Delivery-Instances

2 stars 6 forks source link

Question regarding MCTS #20

Open adinalna opened 3 years ago

adinalna commented 3 years ago

Hi I have ran the search, rollout and select_next_move methods but im still not sure how to code the adapt method:

  1. In line 52 and 53, what does possible move mean? Is it the move a stop could have made but didn’t from the routes of the tour made by the rollout?
  2. Why must we set the stop as visited at the end of the adapt method? Isn’t the stop already visited from the tour made by rollout method? Your help is appreciated. Thanks so much for your time.
NeverOnTimeSdnBhd commented 3 years ago

Hi

I think I explained these things under another issue: https://github.com/NeverOnTimeSdnBhd/Delivery-Instances/issues/2#issuecomment-843721484

adinalna commented 3 years ago

Thanks sir for answering my question. I have another mcts question regarding line 29 of the search method. Is the iteration referring to iterations=100 or is it a counter from the for loop at line 28? Below my outputs for both ways. I diplayed "SEARCH" everytime before search method is called.

line 29: new_tour=search(level-1,i); i for mcts

line 29: new_tour=search(level-1,iterations); iterations for mcts

I'm confused with why the output comes out this way. Your help is very much appreciated. Thanks so much for your time.

NeverOnTimeSdnBhd commented 3 years ago

Hi

is it a counter from the for loop at line 28

This is the correct concept

adinalna commented 3 years ago

Thanks Sir, I have another question. I have completed my code for MCTS but, when trying with the sample input on the question paper which is

5 10 86 22 0 29 17 1 4 50 8 25 13 6 67 37 5

The code runs fine.

However, when trying with sample input in GitHub: 10 43 22 190 0 23 101 14 54 34 15 55 62 5 28 101 32 137 8 27 148 152 42 113 131 24 175 178 39 144 22 34

It throws an ArrayIndexOutOfBoundsException: Index 5 out of bounds for length 5 at our select_next_move() method.

Is there a reason the output comes out this way? Thanks so much for your help as always.

NeverOnTimeSdnBhd commented 3 years ago

Hi

Sorry for late reply as I am really too busy these days...

It is hard for me to help you debug like this so I can comment nothing...

But in select_next_move function we only have two arrays which are probability and possible_successors, try to print out both of them and debug from there.

adinalna commented 3 years ago

Hi again

I have fixed my code, now it runs good for any input. Found a careless mistake hahah I have a few questions regarding MCTS outputs.

  1. Is it normal for the final output to be different after each search? even though all the inputs and values remain the same?
  2. Is the output for MCTS suppose to be the same as one of the ouputs for basic or greedy search? Because in your samples it is so.

Thanks again in advance!

NeverOnTimeSdnBhd commented 3 years ago

Hi

  1. it might be slightly different because sometimes your device can compute faster and sometimes slower, but for sample with small n it should be able to get the sample result as basic search.
  2. for sample instance with small n you should get same result as basic search, however for instance with large n you won't get the same output