/* * FindSeparator.h * * Created on: Nov 23, 2010 * Author: nikai * Description: find the separator of bisectioning for a given graph */ #include #include #include #include #include #include "PartitionWorkSpace.h" namespace gtsam { namespace partition { // typedef std::map PartitionTable; // from the key to the partition: 0 - separator, > 1: submap id /** the metis Nest dissection result */ struct MetisResult { std::vector A, B; // frontals std::vector C; // separator }; /** * use Metis library to partition, return the size of separator and the optional partition table * the size of dictionary mush be equal to the number of variables in the original graph (the largest one) */ template boost::optional separatorPartitionByMetis(const GenericGraph& graph, const std::vector& keys, WorkSpace& workspace, bool verbose); /** * return the number of submaps and the parition table of the partitioned graph (**stored in workspace.partitionTable**). * return 0 if failed Note that the original output of Metis is 0,1 for submap, and 2 for the separator. */ template int findSeparator(const GenericGraph& graph, const std::vector& keys, const int minNodesPerMap, WorkSpace& workspace, bool verbose, const boost::optional >& int2symbol, const bool reduceGraph, const int minNrConstraintsPerCamera, const int minNrConstraintsPerLandmark); }} //namespace