ruby34-subset_sum-1.0.2p0
simple subset sum problem solver for ruby
Back to search · Project homepage
Description
This module provides both a C and pure ruby simple subset sum problem
solver. The subset sum problem is, given a set of numbers, can the sum
of any subset of those numbers equal a given number. This problem is
NP-complete.
Both the C and pure ruby versions implement a fairly simple
meet-in-the-middle algorithm. The C version uses an AVL tree to store
the data, while the pure ruby version uses a ruby hash. For the C
version to be used, the sum of the positive numbers and the sum of the
negative numbers in the set, as well as the wanted number, must all be
Fixnums. Additionally, max_seconds should be nil or a Fixnum.
Package information
- Ports path
- devel/ruby-subset_sum,ruby34
- Package architecture
- amd64
- Maintainer
- Jeremy Evans <jeremy@openbsd.org>
- Categories
- devel, lang/ruby
- Available flavors
- ruby33, ruby34, ruby40
- Only for architectures
- aarch64, amd64, arm, i386, mips64, mips64el, powerpc, powerpc64, riscv64, alpha, hppa, sparc64
These are ports metadata. Binary availability depends on the release, architecture and mirror. Build and test dependencies are not an installation checklist.
Direct dependencies
Library
Runtime
Build
Test
- devel/ruby-subset_sum,ruby34 ruby34-subset_sum-1.0.2p0
Used by (1 dependency relationships)
Includes library, runtime, build and test relationships. Results load 100 at a time.