Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Primary Navigation

    • Cloud & Deployment
    • Core Language & Structure
    • Data Manipulation & Analysis
    • Engineering Data & Computation
    • External Interfaces & Connections
    • Financial Data & Computation
    • Geographic Data & Computation
    • Geometry
    • Graphs & Networks
    • Higher Mathematical Computation
    • Images
    • Knowledge Representation & Natural Language
    • Machine Learning
    • Notebook Documents & Presentation
    • Scientific and Medical Data & Computation
    • Social, Cultural & Linguistic Data
    • Strings & Text
    • Symbolic & Numeric Computation
    • System Operation & Setup
    • Time-Related Computation
    • User Interface Construction
    • Visualization & Graphics
    • Random Paclet
    • Alphabetical List
  • Using Paclets
    • Get Started
    • Download Definition Notebook
  • Learn More about Wolfram Language

UndirectedGraphs

Guides

  • GraphConstructionandRepresentation
  • Graph Functions
  • GraphOperationsandModifications
  • GraphPropertiesAndMeasurements
  • GraphVisualization
  • Paths, Cycles, and Flows
  • Computation on Graphs

Symbols

  • AlternatingTreeGraph
  • BananaTreeGraph
  • BookGraph
  • CoboundaryPolynomial
  • CombGraph
  • FirecrackerGraph
  • GearGraph
  • GeneralizedTriangularGridGraph
  • Girth
  • GraphicalDegreeSequenceQ
  • HelmGraph
  • IndependencePolynomial
  • KayakPaddleGraph
  • LadderRungGraph
  • PanGraph
  • PositiveIntegerQ
  • RankPolynomial
  • ReliabilityPolynomial
  • ResistanceMatrix
  • SunletGraph
  • TadpoleGraph
  • VertexCoordinateList
  • VertexInsert
PeterBurbery`UndirectedGraphs`
ResistanceMatrix
​
ResistanceMatrix
[graph]
returns the resistance matrix of
graph
.
​
Examples  
(1)
Basic Examples  
(1)
Obtain the resistance matrix of the Petersen graph:
In[1]:=
ResistanceMatrix
[PetersenGraph[]]
Out[1]=
SparseArray
Specified elements: 90
Dimensions: {10,10}

The resistance matrix of the Pappus graph:
In[2]:=
ResistanceMatrix
[GraphData["PappusGraph"]]
Out[2]=
SparseArray
Specified elements: 306
Dimensions: {18,18}

Verify these are the same as GraphData's resistance matrices.
Create two tests:
In[3]:=
tests=TableWith{input=input,output=GraphData[input,"ResistanceMatrix"]},​​TestCreate
ResistanceMatrix
[GraphData[input]],output,TestIDAutomatic,{input,{"PetersenGraph","PappusGraph"}}
Out[3]=
TestObject
Outcome: NotEvaluated
Test ID:
cc3873c9-d226-4af2-9b26-d80dc2aed614
,TestObject
Outcome: NotEvaluated
Test ID:
4daaf145-64a7-40c2-8905-fd627f60e6d1

Run the tests:
In[4]:=
TestReport[tests]
Out[4]=
TestReportObject
Tests count: 2
Success rate:
100%

Run the tests and echo the intermediate results:
In[5]:=
TestReport[tests,HandlerFunctions"TestEvaluated"Echo]
»
EventTestEvaluated,EventID517098df-b6ce-4d04-ac4e-c5ed11ea1cee,TestObjectTestObject
Outcome: Success
Test ID:
cc3873c9-d226-4af2-9b26-d80dc2aed614
Input:
ResistanceMatrix[GraphData[PetersenGraph]]
Expected output:
SparseArray
Specified elements: 90
Dimensions: {10,10}

Actual output:
SparseArray
Specified elements: 90
Dimensions: {10,10}

,OutcomeSuccess
»
EventTestEvaluated,EventID32f978e9-fa4b-493b-982d-ef41f2ab5db0,TestObjectTestObject
Outcome: Success
Test ID:
4daaf145-64a7-40c2-8905-fd627f60e6d1
Input:
ResistanceMatrix[GraphData[PappusGraph]]
Expected output:
SparseArray
Specified elements: 306
Dimensions: {18,18}

Actual output:
SparseArray
Specified elements: 306
Dimensions: {18,18}

,OutcomeSuccess
Out[5]=
TestReportObject
Tests count: 2
Success rate:
100%

SeeAlso
"XXXX"
RelatedGuides
▪
Graph Construction and Representation
▪
Graph Functions
""

© 2025 Wolfram. All rights reserved.

  • Legal & Privacy Policy
  • Contact Us
  • WolframAlpha.com
  • WolframCloud.com