This is intended to uniquely number the links between a mesh of an arbitrary number o nodes (for my needs anywhere between 1 and 50 is OK. The upper limit can be your choice as long as it is higher than 9.
Here are my requirements:
-the result must be an integer between 0 and 255
-the result must be unique in the sense that each pair of numbers shall result in a unique number (call it link ID)
-the input data is a pair of numbers between 1 and X where X can be between 1 and 100. (you can change that to any number higher than 9, the higher the number the better)
-the result must be intuitive in the sense that if I look at the input pair I should be able to guess
Here is an example:
A1 A2 A3 A4 are the nodes
The A1A2 link will be 12
A3A2 link will be 23
Algorithm: take the node indexes arrange them in an ascending order and you have your Link ID
The problem appears when I try to use the above for numbers higher than 10 because A8A10 will be 810 which is greater than 255
Note: I am fine for nodes from 1 to 9. I need solutions for more than 9 nodes