#include #include #include #include using namespace std; using namespace unitpp; // Find the maximum shortest path for inVertex int getEccentricities(igraph_t* inGraph, igraph_vector_t* outResults, igraph_vs_t inFrom, igraph_neimode_t inMode) { // Check to make sure graph isnt empty if (igraph_vcount(inGraph)==0) throw string("Empty graph doesn't have any vertices to measure."); // Get shortest paths igraph_matrix_t lShortestPaths; igraph_matrix_init(&lShortestPaths, 0,0); igraph_shortest_paths(inGraph, &lShortestPaths, inFrom, inMode); // Allocate space for results unsigned int lItems = igraph_matrix_nrow(&lShortestPaths); igraph_vector_resize(outResults, lItems); // Extract results for (unsigned int i=0; i