Graphs & Networks in Mathematica 8

Charles Pooh

Wolfram Research Inc.

Graphs & Networks in Mathematica 8

Networks are all around us — technological networks (the internet, power grids, telephone networks, transportation networks, …), social networks (social graphs, affiliation networks, …), information networks (world wide web, citation graphs, patent networks, …), biological networks (biochemical networks, food webs, …) and many more.

Main Features

•  Built-in representation of arbitrary graphs and networks

•  Full support for directed graphs, undirected graphs, weighted graphs …

•  Comprehensive capabilities for handling small and diagrammatic graphs,  large and complex graphs

•  State-of-the-art graph algorithms

•  Full integration into Mathematica system

•  and more ....

Outline of the talk

Graph Representation and Properties

• Main objects: Graph, TreeGraph, PathGraph

• Additional objects/wrappers functions: DirectedGraph, Vertex, Edge, DirectedEdge

• Attributes functions: VertexAttributes, EdgeAttributes, SetVertexAttributes, SetEdgeAttributes

Construction of Graphs

• Special families: CirculantGraph, CompleteGraph, GridGraph, …

• Data paclets: GraphData, PolyhedronData, ChemicalData, ExampleData, …

• Special constructors: RandomGraph, Graphics/Graphics3D, Mesh, …

• Import & Export: GML, DOT, GraphML, GXL, Graph6, Sparse6, …

Styling, Labeling and Layout

• Basic properties: VertexList, EdgeList, VertexCount, EdgeCount, …

• Predicates: GraphQ, DirectedGraphQ, CompleteGraphQ, SimpleGraphQ, BipartiteGraphQ, …

• Modifications: AddVertex, DeleteVertex, AddEdge, DeleteEdge, …

• Representations: AdjacencyMatrix, IncidenceMatrix, …

• Operations: GraphUnion, GraphComplement, GraphSum, GraphPower, …

• Connectivity: ConnectedGraphQ, ConnectedComponents,  VertexCut, EdgeCut, …

• Cliques, Covers & Independent sets: FindClique, FindVertexCover, FindEdgeCover, FindIndependentEdgeSet, …

• Traversals: TraversalTree, …

• Paths, cycles and flows: FindShortestPath, HamiltonianGraphQ, GraphEccentricity, …

• Polynomials and Invariants: CharacteristicPolynomial, TuttePolynomial, ChromaticPolynomial, …

• Isomorphisms: GraphIsomorphicQ, GraphIsomorphism, SubgraphIsomorphism, …

• Subgraphs: Subgraph, UnderlyingSubgraph, UnderlyingSimpleGraph, …

• Other topics: Graph partititon, Graph coloring, Graph rewriting, Hierarchical graphs …

Operations and Modifications

• Traversal or search algorithms: BreadthFirstTraversal, DepthFirstTraversal, …

• Subgraph constructions: TreeGrowing, …

• Visitor and iterator functions

• Special algorithms: Dijsktra algorithm, Bellman-Ford algorithm, …

Graph Computation and Applications

• Graph drawing: GraphPlot, TreePlot, LayeredGraphPlot, GraphEmbedding, …

• Graph editor and interactivity: FE Editor, Contextual menus, Special typesettings, Palettes, Graph highliting functions …

Graph Programming

• Random graphs: RandomGraph, BernoulliGraphDistribution, UniformGraphDistribution, …

• Planar graphs: PlanarGraphQ, KuratowskiSubgraph, …

• Electrical networks: Laplace matrix, Graph spectrum, …

Graph Representation

Graphs are first class citizens in Mathematica 8, and can be used as input, outputs, in programs and in documents.

Graph[{(Subscript[e, 1]),(Subscript[e, 2]),…}] yields a graph with edges (Subscript[e, j]).
Graph[{(Subscript[v, 1]),(Subscript[v, 2]),…}, {(Subscript[e, 1]),(Subscript[e, 2]),…}] yields the graph with vertices (Subscript[v, i]) and edges (Subscript[e, j]).
Graph[{…,(Subscript[w, i])[(Subscript[v, i]),…],…},{…,(Subscript[w, j])[(Subscript[e, j]),…],…}] yields a graph with vertex and edge properties defined by symbolic wrappers (Subscript[w, i]).

Undirected graphs & UndirectedEdge (<->)

Graph[{1\[UndirectedEdge]2,2\[UndirectedEdge]3,3\[UndirectedEdge]1}]

Directed graphs & DirectedEdge (->)

Graph[{1\[DirectedEdge]2,2\[DirectedEdge]3,3\[DirectedEdge]1}]

Graphs & Wrappers (Button, EventHandler, PopupWindow, Style, Tooltip, …)

Graph[{1,2,Style[3,Red]},{1\[UndirectedEdge]2,2\[UndirectedEdge]3,3\[UndirectedEdge]1,Blue}]

Graph Options (VertexShape, VertexStyle, VertexSize, EdgeStyle, …)

Options[Graph]

Graph[{1\[DirectedEdge]2,2\[DirectedEdge]3,3\[DirectedEdge]1},VertexShapeFunction->"Diamond"]

Graph Representation

•  Graph[…] displays in a notebook as a plot of a graph

•  Graph[…] is converted to an optimized standard form

•  Graph[…] is treated as a raw object by functions like AtomQ, and for purposes of pattern matching

•  Any expression can be used as vertices

web={"Aphid"\[DirectedEdge]"Ladybug","Beetle"\[DirectedEdge]"Mouse","Caterpillar"\[DirectedEdge]"Beetle","Caterpillar"\[DirectedEdge]"Mouse","Caterpillar"\[DirectedEdge]"Towhee","Grasshopper"\[DirectedEdge]"Mouse","Grasshopper"\[DirectedEdge]"Towhee","Ladybug"\[DirectedEdge]"Towhee","Louse"\[DirectedEdge]"Mouse","Mosquito"\[DirectedEdge]"Dragonfly","Mosquito"\[DirectedEdge]"Towhee","Mouse"\[DirectedEdge]"Owl","Sunflower"\[DirectedEdge]"Aphid","Sunflower"\[DirectedEdge]"Caterpillar","Sunflower"\[DirectedEdge]"Grasshopper","Sunflower"\[DirectedEdge]"Louse","Towhee"\[DirectedEdge]"Owl"};

shapes={"Sunflower"->,"Aphid"->,"Ladybug"->,"Towhee"->,"Owl"->,"Grasshopper"->,"Louse"->,"Caterpillar"->,"Beetle"->,"Mosquito"->,"Dragonfly"->,"Mouse"->};

Graph[web,VertexShape-> shapes,VertexSize-> 0.9]

Construction of Graphs

Graphs can be constructed in variety of ways:

Graph, UndirectedEdge (<->) and DirectedEdge (->)

Graph[{1\[UndirectedEdge]2,2\[UndirectedEdge]3,3\[UndirectedEdge]1}]

Curated Graphs

GraphData — collection of theoretical graphs

GraphData["PappusGraph"]

ExampleData — collection of empirical graphs

ExampleData[{"Graphs","ZakaryKarateClub"}]

PolyhedronData . ChemicalData . WordData . CountryData . IsotopeData

Graph[Flatten[Thread[#->CountryData[#,"BorderingCountries"]]&/@CountryData["SouthAmerica"]],VertexShapeFunction-> "Name"]

Parametric Graphs

CompleteGraph — generate a complete graph or a complete k-partite graph

ButterflyGraph . CirculantGraph . CompleteKaryTree . CycleGraph . DeBruijnGraph . GridGraph . HararyGraph . HypercubeGraph . KaryTree . KnightTourGraph . PathGraph . PetersenGraph . StarGraph . TreeGraph . TuranGraph . WheelGraph

Grid[{{CompleteGraph[5,GraphStyle-> "SmallNetwork",PlotLabel-> "CompleteGraph"],ButterflyGraph[2,GraphStyle-> "SmallNetwork",PlotLabel-> "ButterflyGraph"],CirculantGraph[10,{2,4},GraphStyle-> "SmallNetwork",PlotLabel-> "CirculantGraph"],CycleGraph[5,GraphStyle-> "SmallNetwork",PlotLabel-> "CycleGraph"],GridGraph[{2,2,2,2},GraphStyle-> "SmallNetwork",PlotLabel-> "GridGraph"],HararyGraph[4,8,GraphStyle-> "SmallNetwork",PlotLabel-> "HararyGraph"]},{HypercubeGraph[4,GraphStyle-> "SmallNetwork",PlotLabel-> "HypercubeGraph"],KnightTourGraph[4,4,GraphStyle-> "SmallNetwork",PlotLabel-> "KnightTourGraph"],PathGraph[Range[25],GraphStyle-> "SmallNetwork",PlotLabel-> "PathGraph"],PetersenGraph[5,2,GraphStyle-> "SmallNetwork",PlotLabel-> "PetersenGraph"],StarGraph[6,GraphStyle-> "SmallNetwork",PlotLabel-> "StarGraph"],TuranGraph[5,2,GraphStyle-> "SmallNetwork",PlotLabel-> "TuranGraph"]}},Spacings-> {2,2}]

VertexCount[ButterflyGraph[n,k]]

EdgeCount[ButterflyGraph[n,k]]

Random Graphs

RandomGraph — generate random graphs following a graph distribution

UniformGraphDistribution . BernoulliGraphDistribution . BarabasiAlbertGraphDistribution . PriceGraphDistribution . WattsStrogratzGraphDistribution . DegreeGraphDistribution

RandomGraph[{6,7},5]

RandomGraph[UniformGraphDistribution[6,7],5]

RandomGraph[BernoulliGraphDistribution[6,0.7],5]

RandomGraph[BarabasiAlbertGraphDistribution[6,2],5]

Matrix Graphs

AdjacencyGraph — construct a graph from an adjacency matrix

IncidenceGraph . KirchhoffGraph . WeightedAdjacencyGraph .

AdjacencyGraph[{{0,0,1,1,0,1,0,0,0,0},{0,0,0,1,1,0,1,0,0,0},{1,0,0,0,1,0,0,1,0,0},{1,1,0,0,0,0,0,0,1,0},{0,1,1,0,0,0,0,0,0,1},{1,0,0,0,0,0,1,0,0,1},{0,1,0,0,0,1,0,1,0,0},{0,0,1,0,0,0,1,0,1,0},{0,0,0,1,0,0,0,1,0,1},{0,0,0,0,1,1,0,0,1,0}}]

Importing Graphs

Import — import graphs from different graph file formats

“GraphML” . “GXL” . “Graphlet” . “Pajek” . “TGF” . “DOT” . “DIMACS” . “Graph6” . “Sparse6” . “LEDA”

Operations and Modification of Graphs

Subgraph — extract subgraphs
NeighborhoodGraph . UndirectedGraph . DirectedGraph . GraphComplement . GraphUnion . GraphDifference . GraphIntersection . GraphDisjointUnion . BooleanGraph . EdgeAdd . EdgeDelete . VertexAdd . VertexDelete

Styling, Labeling and Layout

Mathematica 8 provides extensive collections of carefully designed graph styles, highlight styles and layout algorithms — with in-depth support for every aspect of styling, labeling and shape generation for graphs as well as designed libraries of edge and vertex shapes.

Highlight Graph Elements

HighlightGraph — highlight vertices, edges or whole subgraphs

g=CompleteGraph[5,VertexSize-> Medium];

HighlightGraph[g,{1,2,3}]

HighlightGraph[g,{3,1\[UndirectedEdge]2}]

HighlightGraph[g,{a_ /; VertexQ[g,a]}]

HighlightGraphStyle — overall collection of styles used for highlighting

”Dashed” . ”Dotted” . ”Thick” . ”VertexTriangle” . ”VertexDiamond” . ”VertexConcaveDiamond” . ”DehighlightFade” . ”DehighlightGray” . ”DehighlightHide”

HighlightGraph[g,{1,2,3},"VertexTriangle"]

HighlightGraph[g,{1,2,3},"VertexDiamond"]

HighlightGraph[g,{1,2,3},"VertexConcaveDiamond"]

HighlightGraph[g,{1,2,3},"DehighlightFade"]

Overall Look and Feel

GraphStyle — overall collection of styles for different graph elements

”BackgroundBlack”. ”BackgroundBlue” . ”BackgroundGold” . ”BackgroundGreen” . ”BasicBlack” . ”BasicBlue” . ”BasicGold” . ”BasicGreen” . ”DiagramBlack” . ”DiagramBlue” . ”DiagramGold” . ”DiagramGreen” . ”DynamicHighlight” . ”LargeNetwork” . ”SmallNetwork” . ”Prototype” . ”SimpleLink” . ”ThickEdge” . ”Vintage” . ”VintageDiagram”

Table[Graph[Table[j->FromDigits[Drop[IntegerDigits[j,2],-1],2],{j,1,10}],DirectedEdges->True,GraphStyle->a,GraphLayout->"SpringEmbedding",ImageSize->imagesize,PlotLabel->Style[a,18,Gray,FontFamily->"Helvetica",Bold]],{a,{"DiagramBlack","DiagramBlue","DiagramGold","DiagramGreen","DynamicHighlight","SmallNetwork"}}]

Table[Graph[Table[j->FromDigits[Drop[IntegerDigits[j,2],-1],2],{j,1,50}],DirectedEdges->False,GraphStyle->a,ImageSize->imagesize,ImagePadding->10,VertexSize->If[a=="VintageDiagram"||a=="ThickEdge"||a=="SimpleLink",Automatic,{"Scaled",.015}],PlotLabel->Style[a,18,Gray,FontFamily->"Helvetica",Bold]],{a,{Automatic,"BackgroundBlack","BackgroundBlue","BackgroundGold","BackgroundGreen","BasicBlack","BasicBlue","BasicGold","BasicGreen","LargeNetwork","Prototype","SimpleLink","ThickEdge","Vintage","VintageDiagram"}}]

Graph Layout

GraphLayout — algorithmic graph layouts

VertexCoordinates — explicit list of vertex coordinates

“SpringEmbedding” . “SpringElectricalEmbedding” . “RadialDrawing” . “LayeredDrawing” . “SpiralEmbedding” . “LinearEmbedding” . “CircularEmbedding”

Vertex and Edge Styles

CompleteGraph[5,VertexStyle -> Red,EdgeStyle-> Blue]

Vertex and Edge Labels [doc]

Vertex and Edges Shapes

GraphElementData["Edge"]

GraphElementData["Vertex"]

Grid[Partition[PetersenGraph[5,2, VertexShapeFunction->#1,EdgeShapeFunction->#2, VertexSize->Medium, ImageSize->{250,250}, GraphStyle->"BackgroundBlue"]&@@@Transpose[{Flatten[GraphElementData["Vertex",#1][[;;#2]]&@@@{{"Basic",5},{"Rounded",3},{"Concave",2}}],{"CarvedArcArrow","FilledArcArrow","HalfFilledArrow","HalfUnfilledDoubleArrow","DiamondLine","DottedLine","DotLine","HalfFilledDoubleArrow","CarvedArrow","UnfilledArrow"}}], 5]]

Interactive Effects

web={"Aphid"\[DirectedEdge]"Ladybug","Beetle"\[DirectedEdge]"Mouse","Caterpillar"\[DirectedEdge]"Beetle","Caterpillar"\[DirectedEdge]"Mouse","Caterpillar"\[DirectedEdge]"Towhee","Grasshopper"\[DirectedEdge]"Mouse","Grasshopper"\[DirectedEdge]"Towhee","Ladybug"\[DirectedEdge]"Towhee","Louse"\[DirectedEdge]"Mouse","Mosquito"\[DirectedEdge]"Dragonfly","Mosquito"\[DirectedEdge]"Towhee","Mouse"\[DirectedEdge]"Owl","Sunflower"\[DirectedEdge]"Aphid","Sunflower"\[DirectedEdge]"Caterpillar","Sunflower"\[DirectedEdge]"Grasshopper","Sunflower"\[DirectedEdge]"Louse","Towhee"\[DirectedEdge]"Owl"};

names = PopupWindow[#,WolframAlpha[#]]& /@ Union[Sequence @@@ web];

shapes={"Sunflower"->,"Aphid"->,"Ladybug"->,"Towhee"->,"Owl"->,"Grasshopper"->,"Louse"->,"Caterpillar"->,"Beetle"->,"Mosquito"->,"Dragonfly"->,"Mouse"->};

Graph[names,web,VertexShape-> shapes,VertexSize-> 0.9]

Context Menu

Graph[Table[j\[UndirectedEdge]FromDigits[Drop[IntegerDigits[j,2],-1],2],{j,1,45}]]

Properties, Operations and Modifications

Mathematica 8 provides an extensive collection of functions for producing new graphs from old.

Basic operations

VertexCount, EdgeCount — the number of vertices and edges in the graph

VertexList, EdgeList — the list of vertices and edges in the graph

VertexIndex, EdgeIndex — the index for a vertex or edge in a graph

EdgeRules — the list of edges as a list of rules

Predicates and Properties [doc]

Operations and Modifications [doc]

Graph Measures, Paths, Cycles and Flows

Measures and Metrics [doc]

Paths, Cycles and Flows [doc]

AdjacencyMatrix, IncidenceMatrix, …

AdjacencyMatrix[g]

IncidenceMatrix[g]

Components and Connectivity [doc]

ConnectedGraphQ, ConnectedComponents,  HararyGraph, VertexCut, EdgeCut, …

ConnectedGraphQ[g]//Timing

ConnectedGraphQ[g,2]//Timing

Construction of a class of reliable network: Frank Harary gave a procedure for constructing a k-connected graph (Subscript[H, k,n]) on n vertices — an optimal k-connected graph.

Table[HararyGraph[5,k],{k,7,11}]

Cliques, Covers & Independent sets [doc]

FindClique, FindVertexCover, FindEdgeCover, FindIndependentEdgeSet, …

Graph Programming

Graph Programming [doc]

Breadth First Search

Depth First Search

Graphs & Networks in Mathematica

Provide an unique, efficient, rich and flexible representation of graphs in a symbolic form suitable for general manipulation.

Gallery

Graph[Table[i\[UndirectedEdge]Mod[i+1,2],{i,15}],VertexSize->.6,VertexLabels->Placed["Name",Center],EdgeStyle->Directive[Thickness[.005],Hue[.15,1,1]],Background->Hue[.2,.3,.5],VertexStyle->Directive[Hue[.2,.3,.6],EdgeForm[{Thick,Hue[.2,.3,.8]}]],ImagePadding->10,ImageSize->imagesize]

vertexStyle=Directive[Hue[.6,.8,1],EdgeForm[{}]];
vertexSize={{"Scaled",.012}};
vertexFunction=Automatic;
vertexLabels=Automatic;
edgeStyle={{Hue[.6,1,1]}};
edgeFunction=Automatic;
edgeLabels=Automatic;
imagesize={360,360};
Graph[Table[j->FromDigits[Drop[IntegerDigits[j,2],-1],2],{j,1,500}],DirectedEdges->False,GraphLayout->"SpringEmbedding",VertexStyle->vertexStyle,VertexSize->vertexSize,VertexShapeFunction->vertexFunction,VertexLabels->vertexLabels,EdgeStyle->edgeStyle,EdgeShapeFunction->edgeFunction,EdgeLabels->edgeLabels,ImagePadding->20,Background->Hue[.6,1,.4],ImageSize->imagesize]

PetersenGraph[5,2,VertexSize->.3,VertexLabels->Placed["Name",Center],EdgeStyle->Directive[Thickness[.005],Hue[.2,1,.3]],Background->Hue[.2,.3,.8],VertexStyle->Directive[Hue[.2,1,.8],EdgeForm[{Thick,Hue[.2,1,.3]}]],ImagePadding->10,ImageSize->imagesize]

SeedRandom[1];
vertexStyle=Directive[Hue[.15,1,.85],EdgeForm[{Thickness[.01],Yellow}]];
vertexSize=Array[#-1->.1RandomInteger[{4,12}]&,100];
vertexFunction=Automatic;
vertexLabels=Placed["Name",Center];
edgeStyle={{Thickness[.005],Yellow}};
edgeFunction=Automatic;
edgeLabels=Automatic;
Graph[Table[j->FromDigits[Drop[IntegerDigits[j,2],-1],2],{j,1,30}],DirectedEdges->False,VertexStyle->vertexStyle,VertexSize->vertexSize,GraphHighlight->{19,22,30,26,3},GraphHighlightStyle->"Thick",VertexShapeFunction->vertexFunction,VertexLabels->vertexLabels,EdgeStyle->edgeStyle,EdgeShapeFunction->edgeFunction,EdgeLabels->edgeLabels,ImagePadding->20,Background->Hue[.15,.7,.7],ImageSize->imagesize]

Graph[Table[j->FromDigits[Drop[IntegerDigits[j,2],-1],2],{j,1,10}],GraphLayout->"SpringEmbedding",DirectedEdges->True,VertexLabels->Placed["Name",Center],VertexSize->.5,VertexStyle->EdgeForm[{}],EdgeStyle->Directive[GrayLevel[.3],Thick,Arrowheads[.04]],VertexShapeFunction->({Lighter[ColorData[1,RandomInteger[{1,50}]],.2],GraphElementData["RoundedRectangle"][##]}&),ImagePadding->20,Background->Hue[.15,.4,.9],ImageSize->imagesize]

hv=Purple;
he={Thickness[.005],Purple};
vertexStyle={{Hue[.15,1,.6],Opacity[.5],EdgeForm[{Hue[.15,.5,.3]}]},1->hv,2->hv,3->hv,4->hv,6->hv,9->hv,12->hv};
vertexLabels=Placed["Name",Center];
edgeStyle={{Hue[.15,.5,.6],Thickness[.003],Opacity[1]},1\[UndirectedEdge]2->he,1\[UndirectedEdge]3->he,2\[UndirectedEdge]4->he,3\[UndirectedEdge]6->he,4\[UndirectedEdge]9->he,6\[UndirectedEdge]12->he};
edgeFunction={{"ShortFilledArrow","ArrowSize"->.025,"ArrowPositions"->.8}};
edgeLabels=Automatic;
imageSize=Medium;
Graph[Table[j->FromDigits[Drop[IntegerDigits[j,2],-1],2],{j,1,50}],DirectedEdges->False,VertexStyle->vertexStyle,VertexSize->.6,VertexLabels->vertexLabels,EdgeStyle->edgeStyle,EdgeShapeFunction->edgeFunction,EdgeLabels->edgeLabels,Background->Hue[.18,.3,.9],ImagePadding->10,ImageSize->imagesize]

hv={Black,EdgeForm[Black],Opacity[1]};
he={Thickness[.02],CapForm["Round"]};
vertexStyle={{Darker[Orange,.3],EdgeForm[Darker[Orange,.3]],Opacity[1]},1->hv,2->hv,3->hv,4->hv,6->hv,9->hv,12->hv};
vertexSize=.4;
vertexFunction=Automatic;
vertexLabels=Automatic;
edgeStyle={Thickness[.01],Opacity[.7],1\[UndirectedEdge]2->he,1\[UndirectedEdge]3->he,2\[UndirectedEdge]4->he,3\[UndirectedEdge]6->he,4\[UndirectedEdge]9->he,6\[UndirectedEdge]12->he};
edgeFunction=({ColorData[1,RandomInteger[{1,50}]],GraphElementData[{"ShortFilledArrow","ArrowSize"->.03,"ArrowPositions"->.85}][##]}&);
edgeLabels=Automatic;
Graph[Table[j->FromDigits[Drop[IntegerDigits[j,2],-1],2],{j,1,48}],GraphLayout->"SpringEmbedding",DirectedEdges->False,VertexStyle->vertexStyle,VertexSize->.8,VertexShapeFunction->vertexFunction,VertexLabels->vertexLabels,EdgeStyle->edgeStyle,EdgeShapeFunction->edgeFunction,EdgeLabels->edgeLabels,Background->Hue[.15,.3,.9],ImagePadding->20,ImageSize->imageSize]

vertexStyle=Array[#->Lighter[ColorData[44,#],.5]&,100];
vertexSize={{"Scaled",.075}};
vertexFunction="RoundedRectangle";
vertexLabels={Placed["Name",Center]};
edgeStyle={{Gray,Opacity[1]}};
edgeFunction={{"ShortUnfilledArrow","ArrowSize"->.025,"ArrowPositions"->1}};
edgeLabels=Automatic;
TreeGraph[{1\[UndirectedEdge]2,1\[UndirectedEdge]3,2\[UndirectedEdge]4,2\[UndirectedEdge]5,3\[UndirectedEdge]6,3\[UndirectedEdge]7,4\[UndirectedEdge]8,4\[UndirectedEdge]9,5\[UndirectedEdge]10,5\[UndirectedEdge]11,6\[UndirectedEdge]12,6\[UndirectedEdge]13,7\[UndirectedEdge]14,7\[UndirectedEdge]15},DirectedEdges->True,VertexStyle->vertexStyle,VertexSize->vertexSize,VertexShapeFunction->vertexFunction,VertexLabels->vertexLabels,EdgeStyle->edgeStyle,EdgeShapeFunction->edgeFunction,Background->Hue[.13,.2,.95],EdgeLabels->edgeLabels,ImagePadding->10,ImageSize->imagesize]

Graph[Table[j->FromDigits[Drop[IntegerDigits[j,2],-1],2],{j,1,200}],DirectedEdges->False,(*VertexLabels->Placed["Name",Above],*)VertexStyle->Black,ImagePadding->5,EdgeShapeFunction->({ColorData[1,RandomInteger[{1,50}]],GraphElementData["Line"][##]}&),EdgeStyle->Thickness[.006],Background->Hue[.15,.2,.9],ImageSize->imagesize]

Graphs and Networks Team