probml / pmtksupport

Various packages used by PMTK.
53 stars 58 forks source link

A bug in perfectElimOrder function #1

Open Tonyecl opened 9 years ago

Tonyecl commented 9 years ago

Hi, I think I've found a bug in "perfectElimOrder.m".

the following code

"G = [ 0 1/3 0 0 ; 1/2 0 0 1/2 ; 0 0 0 1/2 ; 0 1/2 1/2 0];

[order, chordal, cliques, numpa] = perfectElimOrder(G,1); cliques{3}"

generate 3rd clique as ">> cliques{3} ans = 4 4"

The problem is in line 47 => "C{i} = [pa i];" should be replaced by "C{i} = [pa u];". It gives in this case: "cliques{3} ans = 4 3" which is correct and confirmed by another similar function : "maxCardinalitySearch.m".

There is also a problem when the starting initial node choice in "perfectElimOrder.m". Nothing works except the case where "initNode=1" which is default value.

Regards Anton

Tonyecl commented 9 years ago

To avoid the second problem I've just commented line 30, it seems to work now.