jiaoyang-li / eecbs Goto Github PK
View Code? Open in Web Editor NEWA bounded-suboptimal solver for Multi-Agent Path Finding
License: Other
A bounded-suboptimal solver for Multi-Agent Path Finding
License: Other
Prof. Li, thanks for sharing your code. They are really helpful.
I believe these are coding errors after comparison with CBS-H2-RTC.
In the following function:
int CBSHeuristic::minimumVertexCover(const vector<int>& CG)
{
clock_t t = clock();
int rst = 0;
std::vector<bool> done(num_of_agents, false);
for (int i = 0; i < num_of_agents; i++)
{
if (done[i])
continue;
std::vector<int> indices;
indices.reserve(num_of_agents);
std::queue<int> Q;
Q.push(i);
done[i] = true;
while (!Q.empty())
{
int j = Q.front(); Q.pop();
indices.push_back(j);
for (int k = 0; k < num_of_agents; k++)
{
if (CG[j * num_of_agents + k] > 0 || CG[k * num_of_agents + j] > 0)
{
if (!done[k])
{
Q.push(k);
done[k] = true;
}
}
}
}
if ((int) indices.size() == 1) //one node -> no edges -> mvc = 0
continue;
else if ((int)indices.size() == 2) // two nodes -> only one edge -> mvc = 1
{
rst += 1; // add edge weight
continue;
}
std::vector<int> subgraph(indices.size() * indices.size(), 0);
int num_edges = 0;
for (int j = 0; j < (int) indices.size(); j++)
{
for (int k = j + 1; k < (int)indices.size(); k++)
{
subgraph[j * indices.size() + k] = CG[indices[j] * num_of_agents + indices[k]];
subgraph[k * indices.size() + j] = CG[indices[k] * num_of_agents + indices[j]];
if (subgraph[j * indices.size() + k] > 0)
num_edges++;
}
}
if (num_edges > ILP_edge_threshold)
{
rst += greedyMatching(subgraph, (int)indices.size());
double runtime = (double)(clock() - start_time) / CLOCKS_PER_SEC;
if (runtime > time_limit)
return -1; // run out of time
}
else
{
for (int k = 1; i < (int)indices.size(); k++)
{
if (KVertexCover(subgraph, (int)indices.size(), num_edges, i=k, (int)indices.size()))
{
rst += k;
break;
}
double runtime = (double)(clock() - start_time) / CLOCKS_PER_SEC;
if (runtime > time_limit)
return -1; // run out of time
}
}
}
num_solve_MVC++;
runtime_solve_MVC += (double)(clock() - t) / CLOCKS_PER_SEC;
return rst;
}
the following sentences
for (int k = 1; i < (int)indices.size(); k++)
{
if (KVertexCover(subgraph, (int)indices.size(), num_edges, i=k, (int)indices.size()))
{
rst += k;
break;
}
should be :
for (int k = 1; k < (int)indices.size(); k++)
{
if (KVertexCover(subgraph, (int)indices.size(), num_edges, k, (int)indices.size()))
{
rst += k;
break;
}
Hello, I am someone who uses code. I am having a problem with using an irregular map without a grid. The issue is that the robot occupies multiple nodes, and when detecting collisions and applying conflict constraints, I want to apply vertex constraints to all the nodes occupied by the robot's size. Can you help me with this?
Is there a quick way to disallow agents to wait? Otherwise, which classes I need to change?
void targetConflict(int a1, int a2, int v, int t)
{
constraint1.clear();
constraint2.clear();
this->a1 = a1;
this->a2 = a2;
this->constraint1.emplace_back(a1, v, -1, t, constraint_type::LEQLENGTH);
this->constraint2.emplace_back(a1, v, -1, t, constraint_type::GLENGTH);
type = conflict_type::TARGET;
}
Is it correct to put a1 agent in both constraint1 and constraint2?
How to output the success rate by running "driver.cpp" file?
I was trying to install the Boost library on my M1 Mac to run EECBS but none of the available options would allow the code to compile (linker found issues with arm64 v. x86 and that was a big mess to deal with); in the end I found that doing brew install boost actually worked for me and might be more efficient than downloading the library directly!
Hi Jiaoyang, thanks for your great work!
When using the repo, I find that that this segment of code when finding conflicts is no-op.
I'm not sure is it intended for some imcompleted optimization, and will it influence the efficiency of this part.
Lines 148 to 156 in 2c5bf95
Hello, I am using boost.1.8.5.0 version but it seems like some of the libraries in the repo is no longer supported? (i guess),
Thank you so much if you could tell me!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.