Message Boards Message Boards

3 Replies
3 Total Likes
View groups...
Share this post:

Edge and Vertex Connectivity for MultiGraphs?

Posted 11 years ago
Hi guys,

I'm new here, so forgive me if I have mislabeled this post and it has been miscategorized. 

I'm relatively new to Mathematica, and am working on a project for school. I'm having trouble coming up with a way to calculate the edge and vertex connectivity of a multigraph (multiple edges between vertices). I know that Mathematica can calculate these for me, but it does not seem to allow multigraphs; I can plot them using GraphPlot, with MultiedgeStyle->True, but this still does not allow me to get the edge and vertex connectivity. 

Thanks for any help or tips you can offer, and sorry if my question is simple--I'm still learning!


POSTED BY: sam_jeralds
3 Replies
I think EdgeWeight and functions like WeightedAdjacencyMatrix might be what you are seeking.
POSTED BY: Daniel Lichtblau
Posted 11 years ago
Here's the example might help you...
 edges = {UndirectedEdge[1, 2], UndirectedEdge[1, 2], UndirectedEdge[2, 3],
  UndirectedEdge[2, 3], UndirectedEdge[3, 4], UndirectedEdge[3, 4],
  UndirectedEdge[3, 4], UndirectedEdge[1, 5], UndirectedEdge[1, 5],
  UndirectedEdge[1, 5], UndirectedEdge[1, 5], UndirectedEdge[5, 6],
  UndirectedEdge[5, 6], UndirectedEdge[2, 6], UndirectedEdge[6, 4],
  UndirectedEdge[6, 4], UndirectedEdge[6, 4], UndirectedEdge[2, 5],
  UndirectedEdge[2, 5], UndirectedEdge[3, 6]};
 {nedges, weights} = Transpose[Tally[edges]];

g = Graph[nedges, EdgeWeight -> weights,
  VertexLabels -> Placed["Name", Center], EdgeLabels -> "EdgeWeight",
  VertexSize -> .2]

POSTED BY: Jaebum Jung
Posted 11 years ago
Thank you so much! You're a life-saver! 
POSTED BY: sam_jeralds
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract