toms452


toms452, a FORTRAN77 code which implements ACM toms algorithm 452, for generating, one at a time, the combinations of M things out of N.

The text of many ACM toms algorithms is available online through ACM: http://www.acm.org/pubs/calgo or NETLIB: http://www.netlib.org/toms/index.html.

Usage:

call nxcbn ( n, m, ic )
where N is the total number of things, M is the number of things in the combination, and IC(1:N) contains exactly M values of 1, with the rest being 0. On output, IC will be altered to indicate the "next" combination.

Licensing:

The computer code and data files described and made available on this web page are distributed under the MIT license

Languages:

toms452 is available in a FORTRAN77 version.

Related Programs:

toms452_test

combo, a FORTRAN90 library which contains several routines for generating, ranking, or randomly selecting a combination.

SUBSET, a FORTRAN90 library which contains many routines for generating, ranking, or randomly selecting a combination.

Reference:

  1. CN Liu, DT Tang,
    Algorithm 452: Enumerating Combinations of M out of N Objects,
    Communications of the ACM,
    August 1973, Volume 16, Number 8, page 485.

Source Code:


Last revised on 01 December 2005.