Hello Werner,
replace
graphData = {Labeled[a -> b1, "a,b1"], Labeled[a -> b2, "a,b2"],
b1 -> c, b2 -> c};
by
graphData = {Labeled[a \[DirectedEdge] b1, "a,b1"],
Labeled[a \[DirectedEdge] b2, "a,b2"], b1 \[DirectedEdge] c,
b2 \[DirectedEdge] c};
Treeplot requires a graph not just graphdata:
Print[TreePlot[Graph[graphData],
PlotLabel -> Style["1.1 TreePlot from graphData", Blue, Bold],
DirectedEdges -> True, VertexLabeling -> True,
EdgeLabeling -> True]];
Note that I also took out the "a". With these changes the 1st part should run.
I copied the changed version in below:
If[True,(*Test Graph (from Graph-Data)& TreePlot& FindPath*)
Block[{a, b1, b2, c, graphData,
graph},(*Define graphData as a labeled list of edges in a form \
suitable for Graph*)
Print[Style["1 Defining a graph by graphData suitable for Graph",
Red, Bold]];
(* graphData={Labeled[a\[Rule]b1,"a,b1"],Labeled[a\[Rule]b2,"a,b2"],
b1\[Rule]c,b2\[Rule]c};*)
graphData = {Labeled[a \[DirectedEdge] b1, "a,b1"],
Labeled[a \[DirectedEdge] b2, "a,b2"], b1 \[DirectedEdge] c,
b2 \[DirectedEdge] c};
Echo[graphData, "1 graphData: "];
(*Make a Graph-object from graphData*)graph = Graph[graphData];
Echo[Row[{Head[graph], " ", graph}],
"1 make graph from graphData: "];
(*TreePlot and FindPath from graphData*)(* Print[TreePlot[graphData,
Left,a,PlotLabel\[Rule]Style["1.1 TreePlot from graphData",Blue,
Bold],DirectedEdges\[Rule]True,VertexLabeling\[Rule]True,
EdgeLabeling\[Rule]True]];*)
Print[TreePlot[Graph[graphData],
PlotLabel -> Style["1.1 TreePlot from graphData", Blue, Bold],
DirectedEdges -> True, VertexLabeling -> True,
EdgeLabeling -> True]];
(* Print[Style[
Row[{"1.1 FindPath from graphData: All paths from a to c: ",
FindPath[graphData,a,c,Infinity,All]}],Blue,Bold]];*)
Print[Style[
Row[{"1.1 FindPath from graphData: All paths from a to c: ",
FindPath[Graph[graphData], a, c, Infinity, All]}], Blue, Bold]];
(*TreePlot and FindPath from graph*)
Print[TreePlot[graph, Left,
PlotLabel -> Style["1.2 TreePlot from graph", Blue, Bold],
DirectedEdges -> True, VertexLabeling -> True,
EdgeLabeling -> True]];
Print[Style[
Row[{"1.2 FindPath from graph: All paths from a to c: ",
FindPath[graph, a, c, Infinity, All]}], Blue, Bold]];
(*Define graphData as a labeled list of edges in a Form suitable \
for TreePlot*)
Print[Style["2 Defining a graph by graphData suitable for TreePlot",
Red, Bold]];
(* graphData={{a\[Rule]b1,"a,b1"},{a\[Rule]b2,"a,b2"},b1\[Rule]c,
b2\[Rule]c};*)
graphData = {Labeled[a \[DirectedEdge] b1, "a,b1"],
Labeled[a \[DirectedEdge] b2, "a,b2"], b1 \[DirectedEdge] c,
b2 \[DirectedEdge] c};
Echo[graphData, "2 graphData: "];
(*Make a Graph-object from graphData*)graph = Graph[graphData];
Echo[Row[{Head[graph], " ", graph}],
"2 make graph from graphData: "];
(*TreePlot and FindPath from graphData*)(* Print[TreePlot[graphData,
Left,a,PlotLabel\[Rule]Style["2.1 TreePlot from graphData",Blue,
Bold],DirectedEdges\[Rule]True,VertexLabeling\[Rule]True,
EdgeLabeling\[Rule]True]];*)
Print[TreePlot[Graph[graphData],
PlotLabel -> Style["2.1 TreePlot from graphData", Blue, Bold],
DirectedEdges -> True, VertexLabeling -> True,
EdgeLabeling -> True]];
Print[Style[
Row[{"2.1 FindPath from graphData: All paths from a to c: ",
FindPath[Graph[graphData], a, c, Infinity, All]}], Blue, Bold]];
(*TreePlot and FindPath from graph*)
Print[TreePlot[graph, Left,
PlotLabel -> Style["2.2 TreePlot from graph", Blue, Bold],
DirectedEdges -> True, VertexLabeling -> True,
EdgeLabeling -> True]];
Print[Style[
Row[{"2.2 FindPath from graph: All paths from a to c: ",
FindPath[graph, a, c, Infinity, All]}], Blue, Bold]];]]