Skip to content
Snippets Groups Projects
Commit 3d602c73 authored by Paul Nitzke's avatar Paul Nitzke
Browse files

Fix: Correct labeling of bipartite graph nodes

* Before: Although we partition columns the output suggested that the
  row nodes were colored in bipartite graphs
* This was caused by mislabeling in DotWriter, swapping c_ and r_ label
  prefixes.
* The way the labels are currently written this commit also swaps the
  pseudo side flag used for adjacency graphs for correct output
parent bc18be81
No related branches found
No related tags found
1 merge request!44Fix: Correct labeling to display column partition
......@@ -37,7 +37,7 @@ namespace SparseTransform.Convert
private StringBuilder processAdjacencyGraph(AdjacencyGraph inputGraph, StringBuilder output)
{
output.AppendLine("graph G {");
processNodes(inputGraph.GetNodes(), output, true);
processNodes(inputGraph.GetNodes(), output, false);
processEdges(inputGraph.GetNodes(), output, false);
output.AppendLine("}");
return output;
......@@ -57,7 +57,7 @@ namespace SparseTransform.Convert
output.AppendLine("\tforcelabels=true;");
processNodes(inputGraph.GetLeftNodes(), output, true);
processNodes(inputGraph.GetRightNodes(), output, false);
processEdges(inputGraph.GetLeftNodes(), output, true);
processEdges(inputGraph.GetRightNodes(), output, true);
output.AppendLine("}");
return output;
}
......@@ -100,7 +100,7 @@ namespace SparseTransform.Convert
{
foreach (GraphNode v in nodes)
{
output.AppendLine(NodeLabel(v, (left ? "c_" : "r_")));
output.AppendLine(NodeLabel(v, (left ? "r_" : "c_")));
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment