You will probably not find a tool that generates you a formula for your graph. So the only thing you can do is phrasing one formula that makes statements on every single node and every single edge. So make sure that your formula does include all variables from a1, b1, c1 to a5, b5, c5. And also make sure that you add all the rules. Each node must have precisely one color. Two connected nodes may not have the same color.