ninja.pranav.algorithms:kombin

KombiN is an algorithm to get index for combination pair or to get combination pair from index, where all possible combination pairs from two finite sets are sorted by their weight in ascending order.

License

License

Categories

Categories

Ninja User Interface Web Frameworks
GroupId

GroupId

ninja.pranav.algorithms
ArtifactId

ArtifactId

kombin
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

ninja.pranav.algorithms:kombin
KombiN is an algorithm to get index for combination pair or to get combination pair from index, where all possible combination pairs from two finite sets are sorted by their weight in ascending order.
Project URL

Project URL

https://github.com/pranav-ninja/KombiN
Source Code Management

Source Code Management

https://github.com/pranav-ninja/KombiN/tree/master/

Download kombin

How to add to project

<!-- https://jarcasting.com/artifacts/ninja.pranav.algorithms/kombin/ -->
<dependency>
    <groupId>ninja.pranav.algorithms</groupId>
    <artifactId>kombin</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/ninja.pranav.algorithms/kombin/
implementation 'ninja.pranav.algorithms:kombin:1.0.0'
// https://jarcasting.com/artifacts/ninja.pranav.algorithms/kombin/
implementation ("ninja.pranav.algorithms:kombin:1.0.0")
'ninja.pranav.algorithms:kombin:jar:1.0.0'
<dependency org="ninja.pranav.algorithms" name="kombin" rev="1.0.0">
  <artifact name="kombin" type="jar" />
</dependency>
@Grapes(
@Grab(group='ninja.pranav.algorithms', module='kombin', version='1.0.0')
)
libraryDependencies += "ninja.pranav.algorithms" % "kombin" % "1.0.0"
[ninja.pranav.algorithms/kombin "1.0.0"]

Dependencies

test (1)

Group / Artifact Type Version
junit : junit jar 4.13.1

Project Modules

There are no modules declared in this project.

KombiN

Maven Central NuGet npm (scoped) PyPI

KombiN is an algorithm that gives Index # of weighted combination and back, works with combinations of two finite sets ordered by sum and then by difference of combination, without generating and enumerating through possible combinations.

When to use KombiN?

Let's say we have two sets:

Set A = { Apple = 0, Banana = 1, Cucumber = 2 }

Set B = { CEO = 0, CFO = 1, CSO = 2 }

Now get all possible unique combinations for both sets and sort first by sum of combination and after by difference of combination and in the end give Index # to all combinations.

In above example, both sets have zero-based index so KombiN will have output as shown in left side Table below. For example, both sets are in DataTable with Non-zero index, In that case KombiN will have output as shown in right side Table below.

In short, It provides zero and non-zero index based on type of index used in both sets.

Index # ai bi Index # ai bi
0 0 0 1 1 1
1 0 1 2 1 2
2 1 0 3 2 1
3 0 2 4 1 3
4 1 1 5 2 2
5 2 0 6 3 1
6 1 2 7 2 3
7 2 1 8 3 2
8 2 2 9 3 3

You can use KombiN for

  1. Finding the Index # of particular combination
  2. Finding the Combination of particular Index #.

Versions

Version
1.0.0