Skip to content

modular-implicits/Search

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

search

A collection of generic graph search algorithms

DFS Examples:

Simple DFS returning one path:

let edges n = match n with 
              | 0 -> [0;1;2]
              | 1 -> [3;5;6;7;8;9]
              | 2 -> [3]
              | 3 -> [] 
              | _ -> []

let path = dfs {Int} edges (fun n -> n = 3) 0

Using dfsM to return all possible paths:

let all_paths = let edges' n = List.map (fun x -> [x]) (edges n) in
         let pred x = [x = 3] in 
         dfsM  edges' pred 0

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages