| 1 | #include <vector>
|
|---|
| 2 | #include <utility>
|
|---|
| 3 | #include <boost/variant.hpp>
|
|---|
| 4 | #include <boost/graph/adjacency_list.hpp>
|
|---|
| 5 | #include <boost/graph/johnson_all_pairs_shortest.hpp>
|
|---|
| 6 | using std::vector;
|
|---|
| 7 |
|
|---|
| 8 | int main()
|
|---|
| 9 | {
|
|---|
| 10 | typedef boost::variant<int, char> vic;
|
|---|
| 11 | vic q(3);
|
|---|
| 12 | int i = boost::get<int>(q);
|
|---|
| 13 |
|
|---|
| 14 | typedef boost::adjacency_list<boost::vecS, boost::vecS, boost::undirectedS> Graph;
|
|---|
| 15 | typedef std::pair < int, int > Edge;
|
|---|
| 16 | vector<Edge> edges;
|
|---|
| 17 | const unsigned int N = 0;
|
|---|
| 18 | for(unsigned int j = 1; j < N; j++)
|
|---|
| 19 | edges.push_back(Edge(j, 0));
|
|---|
| 20 | Graph g(edges.begin(), edges.end(), N);
|
|---|
| 21 | int dists[N][N];
|
|---|
| 22 | boost::johnson_all_pairs_shortest_paths(g, dists);
|
|---|
| 23 |
|
|---|
| 24 | return 0;
|
|---|
| 25 | }
|
|---|