56 const std::unordered_map<uintptr_t, std::string>* nodeNames) {
57 using SubgraphType =
typename G::SubgraphType;
58 using NodeType =
typename G::NodeType;
59 std::ofstream datfile(filename);
60 datfile << R
"dot(digraph {
62 node [shape = rectangle, style = filled, colorscheme=pastel19]
63 graph [style = filled, color = Gray95]
65 subgraph cluster_l { label = "Legend"; style=solid; color=black
66 empty1 [style = invis, shape=point]
67 empty2 [style = invis, shape=point]
68 incomplete [color = 1]
70 incomplete -> empty1 [label = "normal"]
71 completed -> empty2 [arrowhead = onormal,label = "bidirectional\lpropagation"]
75 const size_t numSubgraphs = graph.numSubgraphs();
76 for (
size_t i = 0; i < numSubgraphs; ++i) {
77 const SubgraphType& s = graph.subgraph(i);
79 datfile <<
" " <<
"subgraph cluster_" << i <<
" { label = \""
80 << detail::getName(&s, i, nodeNames) <<
"\"\n";
82 const size_t numNodes = s.numNodes();
83 for (
size_t j = 0; j < numNodes; ++j) {
84 const NodeType& node = s.node(j);
85 datfile <<
" " <<
reinterpret_cast<uintptr_t
>(&node)
86 <<
" [color = " << (node.isCompleted() ? 2 : 1);
87 datfile <<
" label = \"" << detail::getName(&node, j, nodeNames) <<
"\"]\n";
95 graph.forEachNode([&](
const NodeType& node) {
97 datfile <<
" " <<
reinterpret_cast<uintptr_t
>(&node) <<
" -> "
98 <<
reinterpret_cast<uintptr_t
>(&d);