I have a requirement where I have to label each node in a graph with a number. So that when I reach a leaf node traversing a path in that graph I can use the sum of all the node labels in that path to identify the path.
I know powers of two work. But it has a limitation that I cannot use any number that is greater than $2^{64}$ value. So the maximum number of nodes I can label with powers of $2$ is $64$. I am trying to find ways to remove this limitation.
Let's say the problem is like this:
There is a manual job process that involves 3 stages. Each stage has a set of employees to perform their tasks at that stage. If an employee is working in one stage he cannot be in another stage.
Let's say for the purpose of making it easy to understand, I labeled each employee with powers of 2.
Stage A: 2^1, 2^2, 2^3
Stage B: 2^4, 2^5, 2^6, 2^7, 2^8
Stage C: 2^9, 2^10, 2^11, 2^12, 2^13
So at the end of the process, I want to identify these different paths of moving the job from from Stage A to Stage B to Stage C with numbers.
Example: For a job:
Stage A: 2^2 worked
Stage B: 2^7 worked
Stace C: 2^11 worked
Sum of 2^2, 2^7 and 2^11 is the number that I use to identify this path with. Because I know these sums of powers of twos are always unique if you avoid duplicate powers.
But I can only use it for maximum of 64 employees. Because in Java programming language the integer limit is 2^64. I am trying to remove this limitation. Labelling each employee with text is easy but it is expensive with regards to cpu processing.
Any suggestions would be really helpful.
I am open to any set of numbers with no limitation like this, any mathematical operation between them, can be addition, multiplication, subtraction etc.
Thank you.