octahedron(g) --- overwrite g with the octahedron graph, K(2,2,2)
0001 function octahedron(g) 0002 % octahedron(g) --- overwrite g with the octahedron graph, K(2,2,2) 0003 0004 0005 resize(g,6); 0006 full(g); 0007 clear_edges(g); 0008 0009 elist = [ 0010 1 2 0011 1 3 0012 2 3 0013 4 5 0014 4 6 0015 5 6 0016 1 5 0017 3 5 0018 1 6 0019 2 6 0020 2 4 0021 3 4 0022 ]; 0023 0024 add(g,elist); 0025 0026 0027 xy = [ 0028 0 1/2 0029 -sqrt(3)/4 -1/4 0030 sqrt(3)/4 -1/4 0031 0 -8/3 0032 4/sqrt(3) 4/3 0033 -4/sqrt(3) 4/3 0034 ]; 0035 0036 embed(g,xy);