# There is a problem about Graph3D[.. ]

If I have the coordinates p1={{1,1,1}},p2={{1,1,2},{1,2,1},{2,1,1}},then I use code the following to link them with the centre of p1[].

p1={{1,1,1}};
p2={{1,1,2},{1,2,1},{2,1,1}};
Graph3D[
Table[
UndirectedEdge[p1[], p2[[i]]], {i, Length[p2]}]]


At last all points linked to the p1[] but they ignore the space positions of their coordinates, all the points are in the same plane.

Can anyone give me the advice of how to generate the 3d Graph, meanwhile hold their space positions.I only want the graph, because, the vertexdegree can be counted later.

• This is what you want Graphics3D[Table[Line[{p1[], p2[[i]]}], {i, Length[p2]}], Boxed -> False]? – yode Jul 25 '17 at 17:09
• @yode, Yes you r right, but actually it is the graphics3D giving the similar visual plot, but what I expect to have is the graph that can be analysed under the mathematical way. – 吴剑涛 Jul 26 '17 at 13:36

What you are doing is using the 3D coordinates to indicate the vertices, but Graph and Graph3D won't automatically use these for the embedding. It's easiest to just use integers for the vertices,

p1 = {{1, 1, 1}};
p2 = {{1, 1, 2}, {1, 2, 1}, {2, 1, 1}};
Graph3D[ 