On 6/28/06, Phil Tomson <rubyfan / gmail.com> wrote:
> On 6/28/06, ara.t.howard / noaa.gov <ara.t.howard / noaa.gov> wrote:
> >
> > anyone out there know of a graph library that doesn't use a hash in the impl,
> > thereby restricting only one edge from u -->> v?  i've used rgl extensively in
> > the past but it uses a hash under the hood and has this restriction.
> >
> > i'm coding a FSM class so i need to be able to have multiple labeled edges
> > from u -->> v.
> >
>
> Why can't you use a hash of arrays?
>
> graph = { 'a'=>['b','c'],
>               'b'=>['a'],
>               'c'=>['b', 'c']  }
>
> I've used that sort of structure for FSMs in the past.
>
> Phil
>
>

Wow I feel stupid, not enough sleep and the word graph, I thought you
were trying to visualize a FSM. Implementing a graph -- I have used a
hash of arrays and other times I have used a list of lists (when my
states had a numeric or at least sequential index).

Good thing I am off on vacation, good luck
pth