Skip to content
All library documents

Enumerating Combinations and Permutations for Brute-Force Search

Article MQL5 code base

Summary

The document introduces algorithms for generating every selection of k items from a set of N, either with order ignored (combinations) or preserved (permutations). It frames exhaustive enumeration as a brute-force way to search for an optimal solution when the candidate space is manageable. Examples relevant to trading include exploring routes in a Traveling Salesman Problem and finding candidate currency cycles for triangular arbitrage.

It also notes that the library includes several algorithms and says its implementation of Heap’s algorithm was optimized through benchmarking and profiling. However, the supplied text contains no algorithm details, benchmark figures, worked examples, or complexity analysis, so readers cannot assess the implementation or its performance claims from this excerpt. Exhaustive search also grows rapidly as the number of objects increases, limiting its practicality for large spaces. The referenced demonstration script is named but not included.

Key ideas

  • Combinations select items without regard to order, while permutations preserve order.
  • Exhaustive enumeration can search a finite candidate space for an optimal solution.
  • Potential applications include route search and generating triangular-arbitrage currency candidates.
  • The document mentions an optimized Heap’s algorithm but provides no implementation or benchmark evidence.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.