#pragma once #include "Utils/util.h" #include #include #include #include #include "opencv2/nonfree/nonfree.hpp" using namespace std; using namespace cv; using namespace Utils; // ===================== NOTIFICATION ====================== // //! node is encoded from 0, 2, ..., n-1. // //! cost graph: all cost must be a positive value, and cost // //! of the non-overlap pair is specially set as -1. // // ========================================================= // class Graph { public: Graph() { }; ~Graph(){}; //! single-source shortest path algorithm static vector DijkstraForPath(Mat_ graph, int rootNo); //! shortest path algorithm for all node pairs static vector FloydForPath(Mat_ graph); //! minimum spanning tree static Mat_ extractMSTree(Mat_ graph); //! tool functions static vector traverseBreadthFirst(Mat_ path, int rootNo); static void appendix(Mat_ dist, int root); };