On Jan 21, 2012, at 12:30 PM, Rohan Deshpande wrote:

> I'm building a troubleshooting application. In the first screen the
> user is presented with two questions, each leading them down a certain
> path. At a certain point they are presented with a set of
> answers/suggestions. I'm having difficulty figuring out what the
> appropriate data structure is for something like this.
> 
> Initially I was thinking a tree structure of some sort, but that
> doesn't work well because the probability of convergence of many of
> the paths is pretty high. Answering a question a certain way might put
> you on a totally different path.
> 
> After some cursory research it seems like a graph database of some
> sort is the way to go. I'm imagining each node having a set of
> source_ids, containing the IDs of other questions. Answering each
> question would lead to a search against the database looking for
> source_ids that match the current question. In practice though I'm not
> 100% sure if something like this would work.
> 
> Has anyone built anything like this that can chime in with their
> suggestions (and potential Ruby libs to go with them)?

I’m afraid that you haven’t given us enough to go on here, Rohan.

The appropriate data structure depends on what you are trying to achieve. A 
tree suggests you want a definite sequence with an ending, either going from a 
leaf to the root or vice-versa. A more general graph structure suggests your 
users will be able to wander from question to question more loosely.

It sounds like you’re trying to write an expert system. I would suggest you 
start by doing some reading in that area.

-- 
SD Ruby mailing list
[email protected]
http://groups.google.com/group/sdruby

Reply via email to