XPpermute

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Artificial Intelligence
Introduced first in SolidGeometry 5.4, Creation date: 2023-11-17, Last change: 2025-09-15

Auxiliary fnct to create permutation of sets



See Also:

Example Illustration

 missing image of XPpermute(sc,lists)

Syntax

LL=XPpermute([sc,lists])

Input Parameter

sc: separator; default is ''
lists: cell lists of arguments

Output Parameter

LL: cell list of all combinations of the permutation

Examples


XPpermute(' ',{'ISBIGGER'},{'DOG', 'CAT', 'BIRD', 'LION', 'ELEPHANT'}, {'DOG', 'CAT', 'BIRD', 'LION', 'ELEPHANT'}); XX=ans

References

- Norvig, Peter (1991): Paradigms of Artificial Intelligence Programming, Morgan Kaufmann Publisher, San Mateo, CA, USA



Copyright 2023-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Algorithm (Workflow)

This function, XPpermute, is designed to create permutations of sets. It is part of the SolidGeometry library and was introduced in version 5.4. The function is authored by Tim Lueth and is classified under Artificial Intelligence.

Input Parameters

Output Results

Function Workflow

  1. The function begins by retrieving the separator sc using the helper function getfuncparams. This function extracts the first parameter from varargin, which is a variable-length input argument list.
  2. The function then calls permutevarargin with the remaining elements of varargin (i.e., the lists of arguments) to generate permutations.
  3. The permutations generated by permutevarargin are then joined using the specified separator sc by calling the join function.
  4. The result, LL, is a cell list of all possible combinations of the permutations.

Example Usage

An example call to the function is:

XPpermute(' ', {'ISBIGGER'}, {'DOG', 'CAT', 'BIRD', 'LION', 'ELEPHANT'}, {'DOG', 'CAT', 'BIRD', 'LION', 'ELEPHANT'});

This call will generate permutations of the lists with a space as the separator.

Algorithm explaination created using ChatGPT on 2025-08-18 23:39. (Please note: No guarantee for the correctness of this explanation)

Last html export of this page out of FM database by TL: 2025-09-21