Semiring-based constraint satisfaction and optimization | Synapse