views:

45

answers:

1

For a medical website I'm trying to model a questionnaire that should result in a range of possible diagnoses. The questionnaire is fairly complex with a lot of conditionals. I made a flowchart/decision tree to reflect this questionnaire. I'm using Django to make the website.

Currently I'm thinking of using Python Graph to turn the flow chart into a weighted graph. Each question would be a node and each answer would be an edge+label. I could then walk through the complete graph and the endpoint of the walk would be the fitting diagnose.

Is python graph the best library to model this questionnaire or woul you do it differently (other library or other way of modeling the graph)?

+2  A: 

You are modelling a deterministic finite-state automaton. Have a look at python-automata.

katrielalex
thanks, I'm going to have a look at it. Also good to know that it's a DFA.
Jasper