Message Boards Message Boards

0
|
4222 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Adjacency matrix for vertices of three faces of 8 x 8 x 8 cube?

How do I generate an adjacency matrix for the 168 vertices on three faces of an 8 X 8 X 8 cube. $p_{x,y,z}$ where the values of x,y, and z are between 0 and 7, and at least one of the values x,y, or z must be zero for each point.

First of all, how do I generate the adjacency map for the surface of an 8 X 8 X 8 cube? And then how do I discard the adjacencies for the faces I don't need?

I have tried building this by hand by listing the individual adjacency and using Graph to show me what I've made, and then using AdjacencyMatrix[}, but small typos kill it.

POSTED BY: Kathryn Cramer
2 Replies

Are you speaking about the set of vertices $$\bigcup_{i=0}^7\bigcup_{j=1}^7\{(i,j,0),(j,0,i),(0,i,j)\}$$ i.e. the grid points on three faces except the corner $(0,0,0)$? Also, are two vertices adjacent if they are close in Euclidean space, i.e. $|a-b|\leq1$? Assuming these, I jump to

With[{verts=Flatten[Table[{{i,j,0},{j,0,i},{0,i,j}},{i,0,7},{j,1,7}],2]},
  AdjacencyMatrix@Graph[UndirectedEdge@@@Select[
    Subsets[verts,{2}],#[[1]]!=#[[2]]\[And]Norm[#[[1]]-#[[2]]]<=1&
  ]]
]

which is very inefficient but gets the job done. I hesitate to attempt a MatrixForm on that chunker. It's definitely possible to exploit meshes and built in geomtry to get this data "for free", but specifying it isn't too bad especially if we lazily construct edges out of all pairs of vertices.

POSTED BY: Adam Mendenhall

Thanks. That's very hepful.

POSTED BY: Kathryn Cramer
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract