Skip to main content
added 72 characters in body
Source Link
kglr
  • 403.4k
  • 18
  • 501
  • 959
xy = Transpose[{xcord, ycord}]; SeedRandom[1]; ew = Round[ RandomReal[1, Length@edges], .01]; wam = SparseArray[Thread[edges -> ew], {12, 12}, Infinity]; WeightedAdjacencyGraph[wam, VertexCoordinates -> xy, PlotTheme -> "IndexLabeled", EdgeLabels -> "EdgeWeight", ImageSize -> Large, EdgeShapeFunction -> "CurvedEdge"] 

enter image description here

Update: Add the option

VertexStyle -> Directive[EdgeForm[{Thick, Blue}], LightBlue] 

to color the vertices, and the option

EdgeStyle -> Thread[(DirectedEdge @@@ edges) ->   Thread[{Thick, Arrowheads[{-Large, Large}], ColorData["Rainbow"] /@ ew}]] 

to style edges and add arrow heads at both ends of edges

enter image description here

To render the edges without arrow heads, removeeither (1) use Arrowheads[{EdgeShapeFunction -Large,> Large}] from Directive[...]"CurvedArc" and eitheror (2) add the option DirectedEdges -> False or useand replace EdgeShapeFunction(DirectedEdge @@@ edges) with (UndirectedEdge @@@ edges) in EdgeStyle -> "CurvedArc"...:

enter image description here

xy = Transpose[{xcord, ycord}]; SeedRandom[1]; ew = Round[ RandomReal[1, Length@edges], .01]; wam = SparseArray[Thread[edges -> ew], {12, 12}, Infinity]; WeightedAdjacencyGraph[wam, VertexCoordinates -> xy, PlotTheme -> "IndexLabeled", EdgeLabels -> "EdgeWeight", ImageSize -> Large, EdgeShapeFunction -> "CurvedEdge"] 

enter image description here

Update: Add the option

VertexStyle -> Directive[EdgeForm[{Thick, Blue}], LightBlue] 

to color the vertices, and the option

EdgeStyle -> Thread[(DirectedEdge @@@ edges) ->   Thread[{Thick, Arrowheads[{-Large, Large}] 

to style edges and add arrow heads at both ends of edges

enter image description here

To render the edges without arrow heads, remove Arrowheads[{-Large, Large}] from Directive[...] and either add the option DirectedEdges -> False or use EdgeShapeFunction -> "CurvedArc":

enter image description here

xy = Transpose[{xcord, ycord}]; SeedRandom[1]; ew = Round[ RandomReal[1, Length@edges], .01]; wam = SparseArray[Thread[edges -> ew], {12, 12}, Infinity]; WeightedAdjacencyGraph[wam, VertexCoordinates -> xy, PlotTheme -> "IndexLabeled", EdgeLabels -> "EdgeWeight", ImageSize -> Large, EdgeShapeFunction -> "CurvedEdge"] 

enter image description here

Update: Add the option

VertexStyle -> Directive[EdgeForm[{Thick, Blue}], LightBlue] 

to color the vertices, and the option

EdgeStyle -> Thread[(DirectedEdge @@@ edges) -> Thread[{Thick, Arrowheads[{-Large, Large}], ColorData["Rainbow"] /@ ew}]] 

to style edges and add arrow heads at both ends of edges

enter image description here

To render the edges without arrow heads, either (1) use EdgeShapeFunction -> "CurvedArc" or (2) add the option DirectedEdges -> False and replace (DirectedEdge @@@ edges) with (UndirectedEdge @@@ edges) in EdgeStyle -> ...:

enter image description here

added 617 characters in body
Source Link
kglr
  • 403.4k
  • 18
  • 501
  • 959
xy = Transpose[{xcord, ycord}]; SeedRandom[1]; ew = Round[ RandomReal[1, Length@edges], .01]; wam = SparseArray[Thread[edges -> ew], {12, 12}, Infinity]; WeightedAdjacencyGraph[wam, VertexCoordinates -> xy, PlotTheme -> "IndexLabeled", EdgeLabels -> "EdgeWeight", ImageSize -> Large, EdgeShapeFunction -> "CurvedEdge"] 

enter image description here

Update: Add the option

VertexStyle -> Directive[EdgeForm[{Thick, Blue}], LightBlue] 

to color the vertices, and the option

EdgeStyle -> Thread[(DirectedEdge @@@ edges) -> Thread[{Thick, Arrowheads[{-Large, Large}] 

to style edges and add arrow heads at both ends of edges

enter image description here

To render the edges without arrow heads, remove Arrowheads[{-Large, Large}] from Directive[...] and either add the option DirectedEdges -> False or use EdgeShapeFunction -> "CurvedArc":

enter image description here

xy = Transpose[{xcord, ycord}]; SeedRandom[1]; ew = Round[ RandomReal[1, Length@edges], .01]; wam = SparseArray[Thread[edges -> ew], {12, 12}, Infinity]; WeightedAdjacencyGraph[wam, VertexCoordinates -> xy, PlotTheme -> "IndexLabeled", EdgeLabels -> "EdgeWeight", ImageSize -> Large, EdgeShapeFunction -> "CurvedEdge"] 

enter image description here

xy = Transpose[{xcord, ycord}]; SeedRandom[1]; ew = Round[ RandomReal[1, Length@edges], .01]; wam = SparseArray[Thread[edges -> ew], {12, 12}, Infinity]; WeightedAdjacencyGraph[wam, VertexCoordinates -> xy, PlotTheme -> "IndexLabeled", EdgeLabels -> "EdgeWeight", ImageSize -> Large, EdgeShapeFunction -> "CurvedEdge"] 

enter image description here

Update: Add the option

VertexStyle -> Directive[EdgeForm[{Thick, Blue}], LightBlue] 

to color the vertices, and the option

EdgeStyle -> Thread[(DirectedEdge @@@ edges) -> Thread[{Thick, Arrowheads[{-Large, Large}] 

to style edges and add arrow heads at both ends of edges

enter image description here

To render the edges without arrow heads, remove Arrowheads[{-Large, Large}] from Directive[...] and either add the option DirectedEdges -> False or use EdgeShapeFunction -> "CurvedArc":

enter image description here

Source Link
kglr
  • 403.4k
  • 18
  • 501
  • 959

xy = Transpose[{xcord, ycord}]; SeedRandom[1]; ew = Round[ RandomReal[1, Length@edges], .01]; wam = SparseArray[Thread[edges -> ew], {12, 12}, Infinity]; WeightedAdjacencyGraph[wam, VertexCoordinates -> xy, PlotTheme -> "IndexLabeled", EdgeLabels -> "EdgeWeight", ImageSize -> Large, EdgeShapeFunction -> "CurvedEdge"] 

enter image description here