I would like to create a simple decision tree for a 3-course meal that looks something like the following:
The tuples can be created using the code:
Tuples[{{""}, {"Soup", "Salad"}, {"Chicken", "Patty", "Liver", "Beef"}, {"C", "IC"}}] to get
{{"", "Soup", "Chicken", "C"}, {"", "Soup", "Chicken", "IC"}, {"", "Soup", "Patty", "C"}, {"", "Soup", "Patty", "IC"}, {"", "Soup", "Liver", "C"}, {"", "Soup", "Liver", "IC"}, {"", "Soup", "Beef", "C"}, {"", "Soup", "Beef", "IC"}, {"", "Salad", "Chicken", "C"}, {"", "Salad", "Chicken", "IC"}, {"", "Salad", "Patty", "C"}, {"", "Salad", "Patty", "IC"}, {"", "Salad", "Liver", "C"}, {"", "Salad", "Liver", "IC"}, {"", "Salad", "Beef", "C"}, {"", "Salad", "Beef", "IC"}} To get the decision tree, I've tried using the TreeGraph[] function, but it's too time-consuming writing out each paired rule and then I run into issues of repeats which I can't sort out. In any case, I would like to use the results from the code above, to generate a simple decisions tree. Any ideas?


