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.

How can I have pair of edges between nodes in this kind of graphs?

cities = CityData[{All, #}] & /@ {"Germany"}; bigcities = 
Select[Select[Join @@ cities, FreeQ[#, ""] &], 
CityData[#, "Population"] > 100000 &];
cityCoords = 
Select[CityData[#, "Coordinates"] & /@ bigcities, FreeQ[#, ""] &];
Needs["ComputationalGeometry`"];
pts = Reverse[cityCoords, 2];
dt = DelaunayTriangulation[pts];
toPairs[{m_, ns_List}] := Map[{m, #} &, ns];
edges = Union[Sort /@ Flatten[toPairs /@ dt, 1]];
Graph[edges, ImagePadding -> 20, 
VertexCoordinates -> pts, VertexStyle -> LightBlue, 
VertexLabels -> bigcities[[All, 1]], 
Prolog -> {LightBrown, EdgeForm[{Thick, Black}], 
CountryData["Germany", "FullPolygon"]}, ImageSize -> 800]
share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

Just use DirectedGraph. At default, that will replace undirected edge to a pair of directed edges.

enter image description here

share|improve this answer
    
hamir Thanks.Now I am embarrassed!! –  Alex Sep 24 '13 at 19:21
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.