In this repository you will find implementation of two algoritms in AI field in Java. Please make sure that you run this repo on a good input and stand for the requirments.
The algorithm checks whether two nodes are independent or not.
- check if there is a path between two nodes.
- path can be represented by common cause connection or causal chain
- if there exits path between those two nodes then they are no possible independent.
- Start with initial factors
- local CPTs instantiated by evidence.
- If an instantiated CPT becomes one-valued, discard the factor.
- While there are still hidden variables (not Q or evidence):
- Pick a hidden variable H
- Join all factors mentioning H
- Eliminate (sum out) H
- If the factor becomes one-valued, discard the factor
- Join all remaining factors and normalize