Skip to content

Commit 8a66b83

Browse files
Fix argument ordering in README.md
1 parent 37e01fc commit 8a66b83

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Haskell library containing common graph search algorithms
33

44
[![Build Status](https://travis-ci.org/devonhollowood/search-algorithms.svg?branch=master)](https://travis-ci.org/devonhollowood/search-algorithms)
55

6-
Lots of problems can be modeled as graphs, but oftentimes one doesn't want to use an explicit graph structure to represent the problem. Maybe the graph would be too big (or is infinite), maybe making an explicit graph is unwieldy for the problem at hand, or maybe one just wants to generalize over graph implementations. That's where this library comes in: this is a collection of generalized search algorithms, so that one doesn't have to make the graphs explicit. In general, this means that one provides each search function with a function to generate neighboring states, a predicate which tells when the search is complete, a list of predicates which tell whether a "dead end" has been reached, and an initial state to start from. The result is a path from the initial state to a "solved" state, or `Nothing` if no such path is possible.
6+
Lots of problems can be modeled as graphs, but oftentimes one doesn't want to use an explicit graph structure to represent the problem. Maybe the graph would be too big (or is infinite), maybe making an explicit graph is unwieldy for the problem at hand, or maybe one just wants to generalize over graph implementations. That's where this library comes in: this is a collection of generalized search algorithms, so that one doesn't have to make the graphs explicit. In general, this means that one provides each search function with a function to generate neighboring states, a list of predicates which tell whether a "dead end" has been reached, a predicate which tells when the search is complete, and an initial state to start from. The result is a path from the initial state to a "solved" state, or `Nothing` if no such path is possible.
77

88
## Examples
99
### Change-making problem
@@ -33,7 +33,7 @@ graph = Map.fromList [
3333
]
3434

3535
-- Run dfs on the graph:
36-
-- >>> dfs [] (graph Map.!) (== 4) 1
36+
-- >>> dfs (graph Map.!) [] (== 4) 1
3737
-- Just [3,4]
3838
```
3939

0 commit comments

Comments
 (0)