Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Get the resistance matrix of a graph
ResourceFunction["ResistanceMatrix"][g] gives the resistance matrix of the graph g. |
Compute the resistance matrix of the tetrahedral graph:
In[1]:= | ![]() |
Out[1]= | ![]() |
Compare with the result of GraphData:
In[2]:= | ![]() |
Out[2]= | ![]() |
Compute the resistance matrix of the dodecahedral graph:
In[3]:= | ![]() |
Out[3]= | ![]() |
Get all the unique resistance distances:
In[4]:= | ![]() |
Out[4]= | ![]() |
Compute the resistance matrix of a large graph:
In[5]:= | ![]() |
Out[5]= | ![]() |
Visualize the resistance matrix:
In[6]:= | ![]() |
Out[6]= | ![]() |
A graph:
In[7]:= | ![]() |
Define a function for computing the Kirchhoff index:
In[8]:= | ![]() |
Compute the Kirchhoff index:
In[9]:= | ![]() |
Out[9]= | ![]() |
Define a function for computing the Kirchhoff sum index:
In[10]:= | ![]() |
Compute the Kirchhoff sum index:
In[11]:= | ![]() |
Out[11]= | ![]() |
Visualize the resistance matrices of the Archimedean graphs:
In[12]:= | ![]() |
Out[12]= | ![]() |
Rows and columns of the resistance matrix follow the order given by VertexList:
In[13]:= | ![]() |
Out[13]= | ![]() |
In[14]:= | ![]() |
Out[14]= | ![]() |
In[15]:= | ![]() |
Out[15]= | ![]() |
The number of rows or columns of the resistance matrix is equal to the number of vertices:
In[16]:= | ![]() |
Out[16]= | ![]() |
In[17]:= | ![]() |
Out[17]= | ![]() |
In[18]:= | ![]() |
Out[18]= | ![]() |
A pair of graphs with the same resistance spectra, due to Rickard:
In[19]:= | ![]() |
Out[19]= | ![]() |
The two graphs are not isomorphic:
In[20]:= | ![]() |
Out[20]= | ![]() |
Compute their respective resistance spectra:
In[21]:= | ![]() |
Check that they are identical:
In[22]:= | ![]() |
Out[22]= | ![]() |
Wolfram Language 12.3 (May 2021) or above
This work is licensed under a Creative Commons Attribution 4.0 International License