Very difficult combinatorial auction and capacitated facility location ecole instances #272
Replies: 2 comments
-
Hi, indeed in another thread the same issue is popping up. So there seems to be a discrepancy between the original and Ecole generator instances, at least. (You can generate yourself the original instances using the original code, if you'd like.) The generators were coded to exactly reproduce these generators, so clearly this is a problem. We'll look into it. I notice also that the set covering and maximum independent set problems look maybe a bit too easy as well? Although it might have to do with the underlying switch from SCIP 6 to SCIP 7. |
Beta Was this translation helpful? Give feedback.
-
Hi @cwfparsonson , so, I finally took time to look into it. Here are my conclusions. I think that there is a discrepancy in difficulty between the combinatorial auction instances from the Ecole generator, and from the original paper generators. However, I didn't find any convincing evidence that there was an issue with the capacitated facility location problems. If I just generate them with Ecole, and with the original code, and solve them with the SCIP default setup for example, I get roughly the same mean number of nodes, etc. I looked into your code - spent probably a bit too much time, in fact. I think the discrepancies can be explained in a few ways.
import ecole
import numpy as np
import time
seed = 0
np.random.seed(seed)
ecole.seed(seed)
class StrongBranchingAgent:
def __init__(self, name='sb'):
self.name = name
def action_select(self, state, action_set, **kwargs):
action_idx = state[action_set].argmax()
return action_set[action_idx], action_idx
# init objects
agent = StrongBranchingAgent()
env = EcoleBranching(observation_function=ecole.observation.StrongBranchingScores(pseudo_candidates=False),
information_function='default',
reward_function='default',
scip_params='gasse_2019')
co_classes = {'capacitated_facility_location': ecole.instance.CapacitatedFacilityLocationGenerator(n_customers=100, n_facilities=100)}
# solve instances
num_tests = 50
co_class_stats = {key: {'num_nodes': [], 'solving_time': []} for key in co_classes.keys()}
for co_class in co_classes.keys():
num_episodes = 0
done = True
while num_episodes < num_tests:
# reset env
instance = next(co_classes[co_class])
obs, action_set, reward, done, info = env.reset(instance)
# solve instance
start_t = time.time()
while not done:
action, action_idx = agent.action_select(obs, action_set)
obs, action_set, reward, done, info = env.step(action)
# record stats
solving_time = time.time() - start_t
num_nodes = info['num_nodes']
num_episodes += 1
co_class_stats[co_class]['num_nodes'].append(num_nodes)
co_class_stats[co_class]['solving_time'].append(solving_time)
for co_class in co_class_stats.keys():
print(f'{co_class} | mean num_nodes: {np.mean(co_class_stats[co_class]["num_nodes"])} | mean solving_time: {np.mean(co_class_stats[co_class]["solving_time"]):.3f} s') which fits the MDP framework correctly. (Also, it's a good idea to evaluate on many more instances, I took 50 here, there is a lot of variation.) If you do this, then there doesn't seem to be any difference in mean difficulty. I'm not too sure why your code doesn't work, but for sure we never thought somebody would try to do something like this.
So I would suggest to change how you access the strong branching scores, i.e. passing it in the environment's observation function parameter, and then otherwise for combinatorial auctions we are still investigating the generators, but I'm sure we will eventually find the bug and fix it! |
Beta Was this translation helpful? Give feedback.
-
Hi,
I am trying to reproduce the results of the Gasse et al. 2019 paper (https://arxiv.org/pdf/1906.01629.pdf) for the 4 classes of CO problems. From Table 2 of the paper, it seems that in general, in terms of difficulty (evaluated by number of nodes) on the easy (training) sets,
set_covering
>capacitated_facility_location
>combinatorial_auction
>maximum_independent_set
. However, I am finding thatcapacitated_facility_location
andcombinatorial_auction
take several orders of magnitude more branch-and-bound nodes to solve thanset_covering
andmaximum_independent_set
, which is leading to prohibitively long dataset generation and training times.I just wanted to check that I have the
ecole.instance.Generator
arguments and SCIP solver parameters correct in order to re-produce the Gasse et al. instances for the 4 CO classes. In the below code, I am generatingnum_tests=5
instances for each class of CO problem as I understand them to be generated by Gasse et al., and then solving the instances with strong branching. As shown, this results in orders of magnitude difference in number of nodes and solving time. Any help would be enormously appreciated!Output:
For completeness, here is how I define the
agent
andenv
classes in the above:Beta Was this translation helpful? Give feedback.
All reactions