m=0;
L=4;
k=2;
starts = [ 1 ];
tmp = [
1,2,4.000000e-01;
1,1,6.000000e-01;
2,2,4.000000e-01;
2,3,6.000000e-01;
3,1,6.000000e-01;
4,2,4.000000e-01;
4,3,6.000000e-01;
];
P=sparse(tmp(:,1:2),tmp(:,3),[4 4]);
tmp = [
3,4,4.000000e-01;
];
Q=sparse(tmp(:,1:2),tmp(:,3),[4 4]);
index=1:L; final=index(full(sum(Q,1))>0);
