https://gitlab.com/Aldorn/pds-code
Tip revision: 2ae686a997ec04c8c6441ec8ebea76188e772e80 authored by Max Göttlicher on 15 April 2023, 08:57:57 UTC
testing smith hicks weighted neighborhood
testing smith hicks weighted neighborhood
Tip revision: 2ae686a
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());
}
