2024-05-08 16:03:40 +09:00
|
|
|
/* get number of nodes and edge of graph
|
2024-05-07 08:41:39 +09:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
#include <ogdf/fileformats/GraphIO.h>
|
2024-05-08 16:03:40 +09:00
|
|
|
#include <filesystem>
|
2024-05-07 08:41:39 +09:00
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
using namespace ogdf;
|
|
|
|
|
|
|
|
|
|
|
|
int main(int argc, char* argv[])
|
|
|
|
{
|
|
|
|
|
|
|
|
string input_file = argv[1];
|
|
|
|
Graph G;
|
|
|
|
|
|
|
|
if (!GraphIO::read(G, input_file, GraphIO::readGML)) {
|
|
|
|
std::cerr << "Could not read input.gml" << std::endl;
|
|
|
|
return 1;
|
|
|
|
}
|
2024-05-08 16:03:40 +09:00
|
|
|
string filename = std::filesystem::path(input_file).stem();
|
|
|
|
std::cout << filename << ", " << G.numberOfNodes() << ", " << G.numberOfEdges() << std::endl;
|
2024-05-07 08:41:39 +09:00
|
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|