Skip to content

Commit

Permalink
Update operational.md
Browse files Browse the repository at this point in the history
Put the costs back in to motivate the stratification discussion.
  • Loading branch information
jhellerstein committed May 24, 2016
1 parent 24c7303 commit a29ab16
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/operational.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,17 @@ Because Bloom is data-driven rather than call-stack-driven, recursion may feel a
Have a look at the following classic "transitive closure" example, which computes multi-hop paths in a graph based on a collection of one-hop links:

state do
table :link, [:from, :to]
table :path, [:from, :to]
table :link, [:from, :to, :cost]
table :path, [:from, :to, :cost]
end

bloom :make_paths do
# base case: every link is a path
path <= link {|e| [e.from, e.to]}
path <= link {|e| [e.from, e.to, e.cost]}

# recurse: path of length n+1 made by a link to a path of length n
path <= (link*path).pairs(:to => :from) do |l,p|
[l.from, p.to]
[l.from, p.to, l.cost + p.cost]
end
end

Expand Down

0 comments on commit a29ab16

Please sign in to comment.