Let's say I have Graph $G(v, e)$ I want to draw the graph without crossing edges on space.
By giving $(x, y, z)$ for any Vertex. How can I check if one edge crosses another?
Let's say I have Graph $G(v, e)$ I want to draw the graph without crossing edges on space.
By giving $(x, y, z)$ for any Vertex. How can I check if one edge crosses another?
Put all the vertexes on the first $\vert v\vert$ positive integers of the $x$ axis (so if you have 3 vertexes, they'll be in the coordenates $(1,0,0)$, $(2,0,0)$ and $(3,0,0)$. Then count the amount of edges: $\vert e\vert$.
Now we will draw every edge in a different semiplane, so that no edges cross:
Draw the first edge in the $xz^+$ semiplane. Let's call it $P_0$. Then construct a semiplane, $P_1$ such that $\angle (P_0,P_1) = \frac{2\pi}{\vert e\vert}$ and $P_0 \cap P_1$ is the $x$ axis. Put the second edge in $P_1$.
Construct $P_k$ such that $\angle (P_{k-1},P_k) = \frac{2\pi}{\vert e\vert}$ and $P_{k-1} \cap P_k$ is the $x$ axis. And put the $(k+1)$-th edge there.
All the edges are in a different semiplane so none of them crosses another one.