Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (*23*)
- let fromVertice (g : IGraph) v =
- let byEdgeFromSet r =
- List.concat (List.map g.OutByEdge r)
- let exclude exclusionPredicate list =
- List.filter (fun u -> not (exclusionPredicate u)) list
- let excludeAll exclusionList list =
- exclude (fun u -> List.exists (isVertice u) exclusionList) list
- let rec fromVerticeSet r =
- let p = excludeAll r (byEdgeFromSet r)
- if p = [] then r else fromVerticeSet (p @ r)
- fromVerticeSet [v]
- (*24*)
- let toVertice (g : IGraph) v =
- let destReachableFrom x =
- List.exists (isVertice v) (fromVertice g x)
- let accumulateVertice acc x =
- if destReachableFrom x then x :: acc else acc
- List.fold accumulateVertice [] [0 .. g.Size-1]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement