% Computes the Kronecker Products of The Incidence Matrices of the complete graph with 4 nodes, and the tree with 4 nodes
% David Bloore, August 2011

pause on;
clc;

A=[-1 1 0 0;-1 0 1 0;0 -1 1 0;-1 0 0 1;0 -1 0 1;0 0 -1 1];
B=[-1 1 0 0;0 -1 1 0;0 0 -1 1];
I=eye(4);

display(A);
display(B);

display('Press any key to continue');
pause;
clc;

AtA=A'*A;
BtB=B'*B;

display(AtA);
display(BtB);

display('Press any key to continue');
pause;
clc;

W1=AtA-3*I;
W2=BtB-diag([1 2 2 1],0);

display(W1);
display(W2);

display('Press any key to continue');
pause;
clc;

C=kron(W1,I)+kron(I,W2);
D=kron(W2,I)+kron(I,W1);

display('C=kron(W1,I)+kron(I,W2)');
display(C);

display('D=kron(W2,I)+kron(I,W1)');
display(D);