Semiring is an algebraic structure where we have two binary operations ('addition' and 'multiplication') and relations between them. If we add a unary operation called closure we obtain a closed semiring. In this work we define a closed semiring of matrices, describe three algorithms for computing the closure and some applications of closed semirings in Haskell: reachability in graphs, paths in graphs, polynomials and power series and 0-1 knapsack with repetition.
|