Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I have this graph:

Graph[{a <-> 1, a <-> 2, a <-> 3, a <-> 4, b <-> 5, b <-> 6, 
  b <-> 7, b <-> 8, c <-> 9, c <-> 10, c <-> 11, c <-> 12, d <-> 13, 
  d <-> 14, d <-> 15, d <-> 16, a <-> b, a <-> c, a <-> d, b <-> c, 
  b <-> d, c <-> d, 1 <-> i, 2 <-> j, 3 <-> k, 4 <-> l, 5 <-> m, 
  6 <-> n, 7 <-> o, 8 <-> p, 9 <-> q, 10 <-> r, 11 <-> s, 12 <-> t, 
  13 <-> u, 14 <-> v, 15 <-> w, 16 <-> x, a <-> M, b <-> M, c <-> M, 
  d <-> M}

When the graph is generated in Mathematica, the node in the center of the graph (vertex M) is placed above the point where the two edges a<->c and b<->d cross. This hides some information: it is not clear that {a,b,c,d} are fully connected. How can I make Mathematica change the graphical position of M?

share|improve this question
    
Try GraphLayout, e.g. CircularEmbedding or DiscreteSpiralEmbedding might be useful. –  rasher May 22 at 9:35
add comment

1 Answer 1

up vote 3 down vote accepted
g = Graph[{a <-> 1, a <-> 2, a <-> 3, a <-> 4, b <-> 5, b <-> 6, 
   b <-> 7, b <-> 8, c <-> 9, c <-> 10, c <-> 11, c <-> 12, d <-> 13, 
   d <-> 14, d <-> 15, d <-> 16, a <-> b, a <-> c, a <-> d, b <-> c, 
   b <-> d, c <-> d, 1 <-> i, 2 <-> j, 3 <-> k, 4 <-> l, 5 <-> m, 
   6 <-> n, 7 <-> o, 8 <-> p, 9 <-> q, 10 <-> r, 11 <-> s, 12 <-> t, 
   13 <-> u, 14 <-> v, 15 <-> w, 16 <-> x, a <-> M, b <-> M, c <-> M, 
   d <-> M}, VertexLabels -> "Name"]

Mathematica graphics

SetProperty[{g, M}, VertexCoordinates -> {2.45, 2.8}]

Mathematica graphics

Or like rasher noted you can play with GraphLayout but It's pretty ugly IMO (GraphLayout -> "DiscreteSpiralEmbedding" bellow):

Mathematica graphics

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.