I'm not sure if this is exactly what you want, but at least this is a starting point:
Manipulate[node = {11, 12, 13, 14, 15, 16};
edges = {11 -> 14, 11 -> 16, 12 -> 16, 12 -> 15, 13 -> 15, 13 -> 16,
14 -> 16, 14 -> 15, 15 -> 16, 15 -> 13, 16 -> 15, 16 -> 14};
vertex = {{6.51493919050084`,
44.04756585632944`}, {75.59445680043342`,
50.47455242214042`}, {87.32825501506514`,
13.395648943951699`}, {28.795707353492418`,
3.420138063734413`}, {60.729164933330765`,
16.915777496473908`}, {51.85158892659126`, 25.803692768150313`}};
Dynamic@Show[
Graph[node, Flatten@edges, VertexCoordinates -> vertex,
Frame -> True, VertexSize -> {"Scaled", .02},
VertexLabels -> "Name"], FrameTicks -> True, ImageSize -> 400],
{{x, 11, "Choose Node 1"}, node,
ControlType -> PopupMenu}, {{y, 14, "Choose Node 2"}, node,
ControlType -> PopupMenu},
Button["New Random Node", {AppendTo[vertex,
RandomReal[{Min[vertex], Max[vertex]}, 2]],
AppendTo[node, Max[node] + 1],
AppendTo[edges, {Last@node -> x, Last@node -> y}]}]]
Result:
Please tell me if you need any improvement in the answer.
EDITED
Thanks to Kuba's comments, you might also include a Initialization
in the Manipulate
:
Manipulate[node := {11, 12, 13, 14, 15, 16};
edges := {11 -> 14, 11 -> 16, 12 -> 16, 12 -> 15, 13 -> 15, 13 -> 16,
14 -> 16, 14 -> 15, 15 -> 16, 15 -> 13, 16 -> 15, 16 -> 14};
vertex := {{6.51493919050084`,
44.04756585632944`}, {75.59445680043342`,
50.47455242214042`}, {87.32825501506514`,
13.395648943951699`}, {28.795707353492418`,
3.420138063734413`}, {60.729164933330765`,
16.915777496473908`}, {51.85158892659126`, 25.803692768150313`}};
Dynamic@Show[
Graph[node, Flatten@edges, VertexCoordinates -> vertex,
Frame -> True, VertexSize -> {"Scaled", .02},
VertexLabels -> "Name"], FrameTicks -> True,
ImageSize -> 400], {{x, 11, "Choose Node 1"}, node,
ControlType -> PopupMenu}, {{y, 14, "Choose Node 2"}, node,
ControlType -> PopupMenu},
Button["New Random Node", {AppendTo[vertex,
RandomReal[{Min[vertex], Max[vertex]}, 2]],
AppendTo[node, Max[node] + 1],
AppendTo[edges, {Last@node -> x, Last@node -> y}]}],
Initialization :> {node = {11, 12, 13, 14, 15, 16};
edges = {11 -> 14, 11 -> 16, 12 -> 16, 12 -> 15, 13 -> 15,
13 -> 16, 14 -> 16, 14 -> 15, 15 -> 16, 15 -> 13, 16 -> 15,
16 -> 14};
vertex = {{6.51493919050084`,
44.04756585632944`}, {75.59445680043342`,
50.47455242214042`}, {87.32825501506514`,
13.395648943951699`}, {28.795707353492418`,
3.420138063734413`}, {60.729164933330765`,
16.915777496473908`}, {51.85158892659126`,
25.803692768150313`}}}]
Another option would be to included a "reset" Button
:
Manipulate[node := {11, 12, 13, 14, 15, 16};
edges := {11 -> 14, 11 -> 16, 12 -> 16, 12 -> 15, 13 -> 15, 13 -> 16,
14 -> 16, 14 -> 15, 15 -> 16, 15 -> 13, 16 -> 15, 16 -> 14};
vertex := {{6.51493919050084`,
44.04756585632944`}, {75.59445680043342`,
50.47455242214042`}, {87.32825501506514`,
13.395648943951699`}, {28.795707353492418`,
3.420138063734413`}, {60.729164933330765`,
16.915777496473908`}, {51.85158892659126`, 25.803692768150313`}};
Dynamic@Show[
Graph[node, Flatten@edges, VertexCoordinates -> vertex,
Frame -> True, VertexSize -> {"Scaled", .02},
VertexLabels -> "Name"], FrameTicks -> True,
ImageSize -> 400], {{x, 11, "Choose Node 1"}, node,
ControlType -> PopupMenu}, {{y, 14, "Choose Node 2"}, node,
ControlType -> PopupMenu},
Button["New Random Node", {AppendTo[vertex,
RandomReal[{Min[vertex], Max[vertex]}, 2]],
AppendTo[node, Max[node] + 1],
AppendTo[edges, {Last@node -> x, Last@node -> y}]}],
Button["Set initial values", {node = {11, 12, 13, 14, 15, 16};
edges = {11 -> 14, 11 -> 16, 12 -> 16, 12 -> 15, 13 -> 15,
13 -> 16, 14 -> 16, 14 -> 15, 15 -> 16, 15 -> 13, 16 -> 15,
16 -> 14};
vertex = {{6.51493919050084`,
44.04756585632944`}, {75.59445680043342`,
50.47455242214042`}, {87.32825501506514`,
13.395648943951699`}, {28.795707353492418`,
3.420138063734413`}, {60.729164933330765`,
16.915777496473908`}, {51.85158892659126`,
25.803692768150313`}}}]]
11->x1->14
,11->x2->14
,11->x3->14
instead of11->x1->x2->x3->14
? $\endgroup$