I have a graph with 5811 vertices; only known at run-time and thus could be anything but usually less than 6000. Initializing the vertices takes up a lot of time at 35 milliseconds. I was wondering if anyone has a suggestion on how I can improve the vertex allocation speed ? I have looked through some other threads but it seems like there is no definite solution.
EDIT: It takes 35ms due to the amount of variables present in each vertex
//find amount of vertices required
//...
//35ms
//initialize vertices
for (int i = 0; i < max + 1; i++) boost::add_vertex(i, g);
//10ms
//fill up adjacency list and accumulate vertex information
for (int row = 0; row < label.rows; row++)
for (int col = 0; col < label.cols; col++)
{
//process data
}