partitionLMG(G)
This function makes a partition $U\cup W$ of the vertices V of a loopless mixed graph such that:
 if $ij$ in $G$ then $i,j\in U$,
 if $i\leftarrow \rightarrow j$ in $G$ then $i,j\in W$
 there is no directed edge $i\to j$ in $G$ such that $i\in W$ and $j\in U$.
These conditions are equivalent to those introduced in Seth Sullivant, Kelli Talaska, and Jan Draisma, Trek separation for Gaussian graphical models, The Annals of Statistics 38.3 (2010): 16651685.
For technical purposes we assume, without loss of generality, that vertices in the LMG are ordered such that:
1. all vertices in U come before vertices in W,
2. if there is a directed edge from $i$ to $j$, then $i<j$.
This method checks that the input contains no loops and it requires the graph to be directed acyclic, i.e., there should not be any directed cycles after the identification of the connected undirected and bidirected components.





The vertices that are adjacent only to directed edges are sorted depending on their order. If v is such a vertex and v < max U, then v is added to U. Otherwise, it is added to W.










The object partitionLMG is a method function.