# Drawing dynamical trajectories diagram in Mathematica

I've a Boolean gene regulation system composed of vectors(corresponding to cellular phenotypes). Their components are binary numbers such as $\{1,0,0,1\}$. A vector can change its statement in timesteps. For example $\{1,0,0,1\} \longrightarrow \{1,1,0,0\} \longrightarrow \{0,0,1,0\}$, etc.

I know there are several programs doing that but can I draw a vector flow diagram in Mathematica? I mean every vector will correspond to a node(or point) and go to one another. If

$\{1,0,0,1\} = a, \{1,1,0,0\} = b, \{0,0,1,0\} = c$, where $a,b,c$ are constants,

then we have $a \longrightarrow b \longrightarrow c$.

The way above is just what i thought. Maybe there are more efficient ones.

Here is a link of the article containing what I exactly want Figure 2

I think this code answers the question:

data = RandomInteger[{0, 1}, {120, 4}];

edges = DirectedEdge @@@ Partition[data, 2, 1];

Graph[edges, VertexLabels -> "Name"]


## Continuation...

Because of a question in a comment here is some code that shows the derivation of graphs, spanning trees of those graphs, their disjoint union, and a highlighted connecting path between them. I used disjoint union for clarity (with those random data graphs) -- regular graph union is probably desired with the actual data.

{data1, data2, data3} =
Table[RandomInteger[{0, 1}, {n, 4}], {n, {120, 80, 70}}];
{gr1, gr2, gr3} =
Map[Graph[DirectedEdge @@@ Partition[#, 2, 1]] &, {data1, data2,
data3}]


{tr1, tr2, tr3} = Map[FindSpanningTree[#] &, {gr1, gr2, gr3}]


gr = GraphDisjointUnion[tr1, tr2, tr3, VertexLabels -> "Name"];
connectingEdges =
DirectedEdge @@@
Partition[
Most[Accumulate[
Prepend[Length[VertexList[#]] & /@ {gr1, gr2, gr3}, 1]]], 2,
1];

• I think GraphLayout -> "LayeredDigraphEmbedding" should select the proper root vertex for a directed tree. If not, it has  "RootVertex" suboption. – Szabolcs Apr 22 '16 at 14:23