Skip to main content
3 of 4
added 1175 characters in body
TraceKira
  • 383
  • 1
  • 8

TreePlot remove an arrow

Is it possible to make Mathematica make a connection to p2 from both SysVar 2 and SysVar3 like I drawn ?

enter image description here

Code:

listNodesSubsystemView = Join[{ "xxx" -> "SubSystems"}, 
   Reverse[{"SubSystems" -> "SysVar1", "SubSystems" -> "SysVar2", 
     "SubSystems" -> "SysVar3"}],
    Reverse[{"SysVar1" -> "p1", "SysVar2" -> "p2", "SysVar3" -> "p3", 
     "SysVar3" -> "p2"}],
   Reverse[{{"p1" -> "Sp11", "value set"}, {"p1" -> "Sp12", 
      "value set"}, {"p3" -> "Sp31", "value set"}, {"p3" -> "Sp32", 
      "value set"}}], {{"p2" -> "Sp21", "value set"}}];
TreeSubSystem = 
  TreePlot[listNodesSubsystemView, Left, 
   First[ First[listNodesSubsystemView]], VertexLabeling -> True, 
   DirectedEdges -> True];

I used the solution of renaming after the tree was created but it gets out of hand quickly : enter image description here

listNodesSubsystemView = Join[{ "xxx" -> "SubSystems"}, 
   Reverse[{"SubSystems" -> "SysVar1", "SubSystems" -> "SysVar2", 
     "SubSystems" -> "SysVar3"}],
   Reverse[
    {"SysVar1" -> "p1S1", "SysVar1" -> "p2S1", "SysVar1" -> "p3S1",
     "SysVar2" -> "p1S2", "SysVar2" -> "p2S2", "SysVar2" -> "p3S2",
     "SysVar3" -> "p3S3", "SysVar3" -> "p2S3"}],
   Reverse[{"p1S1" -> "Sp11", "p1S1" -> "Sp12", "p2S1" -> "Sp21", 
     "p2S1" -> "Sp22",(*in system variant S1*)
     "p1S2" -> "Sp11", "p2S2" -> "Sp21", "p3S2" -> "Sp31", 
     "p3S2" -> "Sp32",(*in system variant S2*)
     "p3S3" -> "Sp31"}]];(*in system variant S3*)
TreeSubSystem = 
  TreePlot[listNodesSubsystemView, Left, 
      First[ First[listNodesSubsystemView]], VertexLabeling -> True, 
      DirectedEdges -> True] /. "p2S1" | "p2S2" | "p2S3" -> "p2" /. 
    "p3S1" | "p3S2" | "p3S3" -> "p3" /. 
   "p1S1" | "p1S2" | "p1S3" -> "p1";
TraceKira
  • 383
  • 1
  • 8