I'm trying to make a tree with two different colors of edges, black and gray. This is my code:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning,automata}
\definecolor{light-gray}{gray}{0.6}
\begin{document}
\begin{tikzpicture}[line width=.1cm,shorten >=0pt,auto,on grid=false, every state/.style={minimum size=0pt}, level distance=2.0cm, level 1/.style={sibling distance=2cm}, level 2/.style={sibling distance=1cm}, level 3/.style={sibling distance=.5cm}]
\tikzstyle{every node}=[font=\tiny , circle, outer sep=0pt, inner sep=0pt]
\node[] (S) {}
child {node[state] (S1) {}
child {node[state] (S11) {} edge from parent[light-gray] }
child {node[state] (S12) {}}}
child {node[state] (S2) {}
child {node[state] (S21) {}}
child {node[state] (S22) {} edge from parent[light-gray] }};
\end{tikzpicture}
\end{document}
You can see the output below:
The problem is, I want the black lines to be on top of the gray lines. This is happening in the left subtree, because the left edge is drawn before the right one. However, this is not happening in the right subtree. I want the right subtree to be a mirror image of the left subtree. This is what it should look like:
I tried changing the order of the gray and black nodes and trying to specify the direction of the children, like this:
child[right] {node[state] (S22) {} edge from parent[light-gray] }
child[left] {node[state] (S21) {}}};
and this:
child {node[state, right] (S22) {} edge from parent[light-gray] }
child {node[state, left] (S21) {}}};
but it doesn't work!
Any help would be appreciated!