Program Listing for File GraphReader.hpp

↰ Return to documentation for file (include/networkit/io/GraphReader.hpp)

/*
 * GraphReader.hpp
 *
 *  Created on: 17.01.2013
 *      Author: Christian Staudt
 */

#ifndef NETWORKIT_IO_GRAPH_READER_HPP_
#define NETWORKIT_IO_GRAPH_READER_HPP_

#include <networkit/auxiliary/StringTools.hpp>
#include <networkit/graph/Graph.hpp>

namespace NetworKit {

class GraphReaderOptions {
public:
    // How to deal with multi-edges
    enum MultipleEdgesHandling {
        DISCARD_EDGES,  // Reads and selects the first edge which occurs and discards all following
        SUM_WEIGHTS_UP, // If an edge occurs again, the weight of it is added to the existing edge
        KEEP_MINIMUM_WEIGHT // The edge with the lowest weight is kept
    };
};

template <class GraphT>
class GraphReaderBase : public GraphReaderOptions {
public:
    virtual ~GraphReaderBase() = default;

    virtual GraphT read(std::string_view path) = 0;
};

using GraphReader = GraphReaderBase<Graph>;

} /* namespace NetworKit */
#endif // NETWORKIT_IO_GRAPH_READER_HPP_