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

In a specific map scene, the cbs algorithm cannot find a solution and falls into an infinite loop #46

Open
lvyv opened this issue Feb 7, 2023 · 1 comment

Comments

@lvyv
Copy link

lvyv commented Feb 7, 2023

I once made a map as attachment,
'#' means obstacle,
'.' means space,
'1','2','3' is start position of three agent, and 'A', 'B', 'C' is the goal position one by one.

When I apply the cbs implemention, It falls into an infinite loop.
To reproduce the problem, I slightly modifed the source code of cbs.cpp as following.
......
// std::unordered_set obstacles;
// for (const auto& node : config["map"]["obstacles"]) {
//obstacles.insert(Location(node[0].as(), node[1].as()));
// }
std::unordered_set obstacles;
std::ifstream map(mapFile);

int y = 0;
while (map.good()) {
std::string line;
std::getline(map, line);
int x = 0;
for (char c : line) {
if (c == '#') {
obstacles.insert(Location(x, y));
}
++x;
}
++y;
}
......

map.txt

@whoenig
Copy link
Owner

whoenig commented Feb 7, 2023

  • CBS does not guarantee to terminate with an error if no solution exists. (From your map, it looks like a solution should exist, though)
  • You can try with bounded suboptimal variants, such as ECBS, since CBS can be very slow on larger examples.

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