
24 May
2009
24 May
'09
7:09 a.m.
Hello, I want to get the top or the bottom elements of a graph, but the following code appears to give the wrong answer in most cases, and the right answer in a few cases. Any ideas? -- get the most general or the least general elements graphMLGen :: Bool -> Gr [Rule] () -> Gr [Rule] () graphMLGen pm gr = buildGr unctxls where unctxls = map remadj ctxls remadj (_,n,r,_) = ([],n,r,[]) ctxls | pm = gsel (\x -> outdeg' x == 0) gr | otherwise = gsel (\x -> indeg' x == 0) gr Many thanks, Hans van Thiel