vendredi 27 mars 2015

Simple graphs (without parallel edges) in fgl?


Vote count:

0




Are there any provisions in http://ift.tt/1D7mHbL for handling simple graphs (i.e., no parallel edges)? At the moment, we get



import Data.Graph.Inductive
mkGraph [(1,()),(2,())] [(1,2,()),(1,2,())] :: Gr () ()

==> mkGraph [(1,()),(2,())] [(1,2,()),(1,2,())]


containing two edges from 1 to 2. Indeed for this graph,



suc g 1 ==> [2,2]


Just to show that I've done some research: the official documentation http://ift.tt/1yk46Sp (paper linked from original web page) states in Section 2.1 "we define one type for directed, node-labelled, edge-labelled multi-graphs; other graph types can be obtained as special cases" but then am seeing just the trivial specialisation (no label = label ()), but nothing on simple graphs.


For simple graphs, the type of Adj b, which occurs in Context a b, should perhaps be Set (b,Node) instead of [(b,Node)] as it is now. (Or even Map b (Set Node), or Map Node (Set b) ...)


Somewhat related: is there a method that allows to check for the presence of an edge, or give me the set of edges from one node p to another node q? At the moment it seems I have to find q by walking through suc g p. And that's a list, which worries me even more. What if my graph has nodes with large degree?



asked 1 min ago







Simple graphs (without parallel edges) in fgl?

Aucun commentaire:

Enregistrer un commentaire