You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently a Set ( Int, Int ) is used to track unique edges, but this involves allocating (and comparing) a lot of tuples. Instead, build up a Set Int where each Int is a packed edge index equal to
Then, once that set is constructed, use Set.foldr to iterate through the set, unpack each Int back into an ( Int, Int ) using mod and //, and accumulate these values into a list. This should maintain the property that edges are returned in sorted order with lower vertex index first and higher vertex index second.
The text was updated successfully, but these errors were encountered:
Currently a
Set ( Int, Int )
is used to track unique edges, but this involves allocating (and comparing) a lot of tuples. Instead, build up aSet Int
where eachInt
is a packed edge index equal toThen, once that set is constructed, use
Set.foldr
to iterate through the set, unpack eachInt
back into an( Int, Int )
usingmod
and//
, and accumulate these values into a list. This should maintain the property that edges are returned in sorted order with lower vertex index first and higher vertex index second.The text was updated successfully, but these errors were encountered: