2

I want to draw the diagram shown in the image shown below. I want to use Mathematica's Graph tool.

enter image description here

I evaluated

Graph[
  {6 \[DirectedEdge] 7, 5 \[DirectedEdge] 7, 3 \[DirectedEdge] 6, 
   3 \[DirectedEdge] 5, 4 \[DirectedEdge] 6, 2 \[DirectedEdge] 5, 
   1 \[DirectedEdge] 4, 1 \[DirectedEdge] 3, 1 \[DirectedEdge] 2}, 
  VertexStyle -> White, VertexSize -> 0.1, VertexLabels -> "Name", 
  EdgeStyle -> Black] 

and the result was

enter image description here

What can I do to make Mathematica produce a graph that looks like the one that I want?

m_goldberg
  • 107,779
  • 16
  • 103
  • 257
Emad kareem
  • 864
  • 1
  • 5
  • 13
  • This isn't a "do your homework" website. Please show us what you've tried and where you've run into problems. – Feyre Dec 23 '16 at 14:40
  • when I draw this in mathematica become as – Emad kareem Dec 23 '16 at 14:57
  • I want to be like drawing the picture first!! this is my problem?? – Emad kareem Dec 23 '16 at 15:03
  • "when I draw this in mathematica" - what did you input into Mathematica to do this? Tell us here, and we can start from there. – J. M.'s missing motivation Dec 23 '16 at 15:19
  • Graph[{6 [DirectedEdge] 7, 5 [DirectedEdge] 7, 3 [DirectedEdge] 6, 3 [DirectedEdge] 5, 4 [DirectedEdge] 6, 2 [DirectedEdge] 5, 1 [DirectedEdge] 4, 1 [DirectedEdge] 3, 1 [DirectedEdge] 2}, VertexStyle -> White, EdgeStyle -> Black, VertexSize -> 0.1, VertexLabels -> "Name"] – Emad kareem Dec 23 '16 at 15:20
  • Have you looked at the documentation of VertexStyle, VertexLabels, VertexFunction etc? – Feyre Dec 23 '16 at 17:14
  • If you want to control the layout you need to specify `VertexCoordinates" – george2079 Dec 23 '16 at 18:28
  • You might find this useful: http://mathematica.stackexchange.com/q/2715/2079 – george2079 Dec 23 '16 at 18:29
  • 3
    I'm voting to close this question as off-topic because this isn't a specific question, the OP is simply asking others to supply his code. – Feyre Dec 23 '16 at 19:34
  • You can start from http://mathematica.stackexchange.com/questions/131587/creating-a-diagram/131646#131646 – cyrille.piatecki Dec 23 '16 at 20:17
  • Look into VertexCoordinates as george2079 said, or try GraphLayout -> {"LayeredDigraphEmbedding", "Orientation" -> Left}. –  Dec 23 '16 at 21:26

1 Answers1

5

Could this be satisfacing ?

Graph[{1 -> 2, 1 -> 3, 1 -> 4, 2 -> 5, 3 -> 5, 3 -> 6, 4 -> 6, 
  5 -> 7, 6 -> 7}, 
 VertexCoordinates -> {{0, 1}, {1.1, 2}, {1, 1}, {1, 0}, {2, 2}, {2, 
    0}, {3, 1}},
 VertexShape -> Graphics[{LightGreen, Rectangle[{10, 10}]}], 
 VertexSize -> .2,
 VertexLabels -> {1 -> Placed["A", Center], 2 -> Placed["B", Center], 
   3 -> Placed["C", Center], 4 -> Placed["D", Center], 
   5 -> Placed["E", Center], 6 -> Placed["F", Center], 
   7 -> Placed["G", Center]},
 EdgeShapeFunction -> ({Arrowheads[{{.03, 1}}], 
     Arrow[#1, {.07 #2[[1]], .06 #2[[2]]}]} &)]
cyrille.piatecki
  • 4,582
  • 13
  • 26