DISCLAIMER: I'm new to bayesian Networks and Adjacency Matrix
hey guys,
So I'm making this very simple Bayesian network and I am trying to represent it using an Adjacency Matrix. . So above is a graphical representation of the problem. We see that we have a cycle between node A, B, and C. And I want to prevent that. Now here is how I am trying to represent my graph in code (using an Adjacency Matrix or double loop).
I'm writing this method called checkDag(int[][] AdjacencyMatrixInput)
it takes an AM and check if the DAG constraint is violated or not. i've started some code but keep getting stuck. Really would appreciate the help! (pseudocode or actual code would be great).
public void checkDag(Node[][] AM)
{
for(int i = 0; i < AM.length; i++)
{
for(int j = 0; j < AM[i].length; j++)
{
if(AM[i][i].value == 1)
{
//getting stuck on how to check parents.
}
}
}
}