#include <algorithm>
#include <memory>
#include <numeric>
#include <string>
#include <vector>
#include "absl/strings/numbers.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"
#include "absl/strings/str_join.h"
#include "absl/strings/str_split.h"
#include "ortools/base/filelineiter.h"
#include "ortools/base/statusor.h"
#include "ortools/graph/graph.h"
Go to the source code of this file.
|
| | util |
| | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
|
| |
|
| template<class Graph > |
| std::string | util::GraphToString (const Graph &graph, GraphToStringFormat format) |
| | Implementations of the templated methods. More...
|
| |
| false | util::ValueOrDie ()) |
| | Read a graph file in the simple ".g" format: the file should be a text file containing only space-separated integers, whose first line is: <num nodes>=""> <num edges>=""> [<num_colors> <index of first node with color #1> <index of first node with color #2> ...] and whose subsequent lines represent edges if "directed" is false, or arcs if "directed" is true: <node1> <node2>. More...
|
| |
| * | util::if (!error_or_graph.ok()) |
| |
| template<class Graph > |
| ***util::StatusOr< Graph * > | util::ReadGraphFile (const std::string &filename, bool directed, std::vector< int > *num_nodes_with_color_or_null) |
| |
| template<class Graph > |
| util::Status | util::WriteGraphToFile (const Graph &graph, const std::string &filename, bool directed, const std::vector< int > &num_nodes_with_color) |
| | Writes a graph to the ".g" file format described above. More...
|
| |
| template<class Graph > |
| util::StatusOr< Graph * > | util::ReadGraphFile (const std::string &filename, bool directed, std::vector< int > *num_nodes_with_color_or_null) |
| |