Function graspi::compute_shortest_distance_from_sourceC_to_targetC

Function Documentation

void graspi::compute_shortest_distance_from_sourceC_to_targetC(unsigned int sourceC, unsigned int targetC, graph_t *G, const dim_g_t &d_g, const vertex_colors_t &C, const edge_weights_t &W, std::vector<float> &d, std::string filename = "")

The function to compute the shortest path from the source vertex to target vertex

Parameters
  • sourceC: is the color/label of the source vertex

  • targetC: is the color/label of the source vertex

  • G: is the input graph

  • d_g: is the reference to the struct storing the dimension of graph vertices

  • C: is the reference to the vector storing the labels/colors of vertices in the graph G

  • W: is the reference to the map storing the weights of the edges

  • d: is the reference to the vector with the lengths of the shortest paths

  • filename: is the filename to save the results of this function, here the vector of path lengths/distances