https://gitlab.com/Aldorn/pds-code
Tip revision: 233199f30c14fad60720f2922760075eced625fe authored by Max Göttlicher on 19 April 2023, 17:53:20 UTC
greedy upper bounds
greedy upper bounds
Tip revision: 233199f
converter.cpp
//
// Created by max on 31.08.22.
//
#include "graphio.hpp"
int main(int argc, const char** argv) {
if (argc != 2) {
throw std::runtime_error("expected file name");
}
std::string filename = argv[1];
namespace fs = std::filesystem;
fmt::print("opening {}\n", fs::absolute(filename).string());
pds::PowerGrid graph;
if (filename.ends_with(".graph")) {
graph = pds::readEdgeList(filename);
} else if (filename.ends_with(".ptxt")) {
graph = pds::readPtxt(filename);
} else {
throw std::runtime_error("unsupported file: " + filename);
}
fmt::print("graph n={}, m={}\n", graph.numVertices(), graph.numEdges());
}
