How to algorithmically calculate the adjacency matrix of platonic solids I need to devise a algorithm (in Python) that calculates adjacency matrices for the platonic solids. The input into the algorithm needs to be the number of polygons meeting at each vertex and the regular polygon on which they are based. Any ideas are welcome as I've tried a few avenues and haven't come up with anything remotely successful.
Let the number of sides $n$ and let the number of vertexes connected to any particular vertex be $m$.
Take a tetrahedron, it has $n = 3$ and $m = 3$. My problem is then going from this to establishing the following adjacency matrix.
0 1 1 1
1 0 1 1
1 1 0 1
1 1 1 0

This is therefore the adjacency matrix for a tetrahedron. With a cube, it becomes more complicated
0 1 1 0 1 0 0 0
1 0 0 1 0 1 0 0
1 0 0 1 0 0 1 0
0 1 1 0 0 0 0 1 
1 0 0 0 0 1 1 0
0 1 0 0 1 0 0 1
0 0 1 0 1 0 0 1 
0 0 0 1 0 1 1 0     

etc. 
So I need to take the values of $n$, and $m$ to calculate these matrices. Clearly there are many possible solutions depending on how the algorithm labels the vertexes. Any ideas?
My research has suggested that I need to investigate graph theory. I don't have a background in this area so I'm unsure of how to proceed.
To clarify, I have no problem in finding out what they are individually, I was looking for a method of calculating them.
 A: This problem is easy in Mathematica:
MatrixForm /@ 
 (AdjacencyMatrix /@ 
    (PolyhedronData[#, "NetGraph"] & /@ 
       PolyhedronData["Platonic"]))

This gives five adjacency matrices.  Here is just one of them:
$\left(
\begin{array}{cccccc}
 0 & 1 & 1 & 0 & 0 & 0 \\
 1 & 0 & 1 & 1 & 1 & 0 \\
 1 & 1 & 0 & 0 & 1 & 1 \\
 0 & 1 & 0 & 0 & 1 & 0 \\
 0 & 1 & 1 & 1 & 0 & 1 \\
 0 & 0 & 1 & 0 & 1 & 0 \\
\end{array}
\right)$
If you need to calculate them on a case-by-case basis:
MatrixForm@(AdjacencyMatrix@(PolyhedronData["Cube", "NetGraph"]))

or insert "Dodecahedron", "Icosahedron", "Octahedron", or "Tetrahedron" in place of "Cube".
This code words for arbitrary regular solids, such as "SmallRhombicuboctahedron", which has 46 vertexes.
It is curious that the questioner seeks to input $n$ and $m$ for Platonic solids, since there are only five such solids.  (A "Platonic solid" is a meaningless concept, or at best undefined, for any other values of $n$ and $m$.)  So a trivial lookup table from $n$ and $m$ to the name of the solid would be the natural code wrapper.
Here's the code with the basic wrapper:
solidName[n_, m_] := Which[
  {n, m} == {3, 3}, "Tetrahedron", 
  {n, m} == {6, 3}, "Cube",
  {n, m} == {10, 4}, "Dodecahedron",
  {n, m} == {8, 5}, "Octahedron",
  {n, m} == {20, 6}, "Icosahedron"];

n = 8;
m = 5;
MatrixForm@(AdjacencyMatrix@(PolyhedronData[solidName[n, m], 
     "NetGraph"]))

