wolfram technologies graph theory and social networks
play

Wolfram Technologies: Graph Theory and Social Networks Martin - PDF document

Slide 1 of 9 Wolfram Technologies: Graph Theory and Social Networks Martin Hadley Wolfram martinh@wolfram.com | 2 Wolfram-Technologies_Graph-Theory-Social-Networks.nb Slide 2 of 9 Wolfram Technologies Twenty-Four Years of


  1. Slide 1 of 9 Wolfram Technologies: Graph Theory and Social Networks Martin Hadley Wolfram martinh@wolfram.com | � �

  2. 2 Wolfram-Technologies_Graph-Theory-Social-Networks.nb Slide 2 of 9 Wolfram Technologies Twenty-Four Years of Scientific and Technological Innovation � Founded by Stephen Wolfram in 1987, British scientist, creator of Mathematica and Wolfram|Alpha and the author of A New Kind of Science � Based in Illinois, USA with EMEA offices near Oxford, UK and Asia offices in Tokyo, Japan � Employs 600 staff worldwide � Wolfram Technology users number in the millions - used in most of the Euro Stoxx 50 companies, several major government departments across the E.U. and all of the world's top 200 universities. The Core of Wolfram Technologies is Mathematica

  3. Wolfram-Technologies_Graph-Theory-Social-Networks.nb 3 Computability drives us forward � We have developed a free to use Computable Knowledge Engine with an ever growing array of computational algorithms and curated data. � We’ve recently launched Wolfram SystemModeler , a multidomain modelling and simulation environment with tight Mathematica integration. | � �

  4. 4 Wolfram-Technologies_Graph-Theory-Social-Networks.nb | � �

  5. Wolfram-Technologies_Graph-Theory-Social-Networks.nb 5 Slide 3 of 9 Graph Theory & Social Networks in Mathematica Building a Graph in Mathematica � Directed and Undirected Graph � Interacting with Graph � Importing/Exporting Graph Graph Theory Analytical Methods � Graph Isomorphs, Complement, Difference and GraphDistributions � Cliques, Centralities, and Communities � Tours and Paths Graph Theory in Financial Engineering: Risk-Diverse Investment Portfolios Analysing Social Networks with Wolfram Technologies � Wolfram|Alpha Personal Analytics for Facebook � Social Network APIs in Mathematica | � �

  6. 6 Wolfram-Technologies_Graph-Theory-Social-Networks.nb Slide 4 of 9 Building Graph in Mathematica The Graph Function In Mathematica a Graph is built by providing a list of edges to the Graph function Undirected Graph Provide a list of undirected edges, � myUnDirectedGraph � Graph �� 1 � 3,2 � 1,3 � 4,1 Directed Graph Building a graph is a non-destructive process, we can easily extract both edges and vertices Extracting Edges We apply the EdgeList function to a graph EdgeList � myUndirectedGraph � Extracting Vertices � 1 � 3, 2 � 1, 3 � 4, 1 � 4 � From this list of rules we can reconstruct the original graph, Graph � EdgeRules � myDirectedGraph �� Symbolic Input We can easily insert symbolic objects into our graph,

  7. Wolfram-Technologies_Graph-Theory-Social-Networks.nb 7 symbolic1 � Graph �� � , � , � , � , � VertexLabels � "Name", VertexSize � Tiny, ImagePadding � 50 � symbolic2 � Graph ��� 2 3 4 1 � � � 0 8 5 7 � , � 9 0 1 1 � � � 2 3 4 1 � , � 0 8 5 7 � � � 9 8 7 5 � , � 2 3 4 1 � � � 9 8 7 5 �� , VertexLabels � "Name", VertexSize � Small, ImagePadding � 30 � 9 8 7 5 9 0 2 3 1 1 4 1 0 8 5 7 The content remains undestroyed by the Graph function. EdgeRules � symbolic1 � � � , , , � � � � Map � MatrixForm, EdgeRules � symbolic2 � , 2 � �� 2 3 4 1 � � � 0 8 5 7 � , � 9 0 1 1 � � � 2 3 4 1 � , � 0 8 5 7 � � � 9 8 7 5 � , � 2 3 4 1 � � � 9 8 7 5 �� We can extend this functionality to build more complicated visualisations

  8. 8 Wolfram-Technologies_Graph-Theory-Social-Networks.nb web � � "Aphid" � "Ladybug", "Beetle" � "Mouse", "Caterpillar" � "Beetle", "Caterpillar" � "Mouse", "Caterpillar" � "Towhee", "Grasshopper" � "Mouse", "Grasshopper" � "Towhee", "Ladybug" � "Towhee", "Louse" � "Mouse", "Mosquito" � "Dragonfly", "Mosquito" � "Towhee", "Mouse" � "Owl", "Sunflower" � "Aphid", "Sunflower" � "Caterpillar", "Sunflower" � "Grasshopper", "Sunflower" � "Louse", "Towhee" � "Owl" � ; shapes � � "Sunflower" � , "Aphid" � , "Ladybug" � , "Towhee" � , "Owl" � , "Grasshopper" � , "Louse" � , "Caterpillar" � , � ; "Beetle" � , "Mosquito" � , "Dragonfly" � , "Mouse" � Styling a Graph Highlighting Graph Features Individual elements of a graph (vertices and edges) can be highlighted specifically HighlightGraph � CompleteGraph � 5 � , � 1, 2, 3 �� HighlightGraph � CompleteGraph � 5 � , � 1 � 2, Style � 3 � 4, Green ���

  9. Wolfram-Technologies_Graph-Theory-Social-Networks.nb 9 Importing and Exporting Graph Import/Export Formats We support import/export of the most widely used file formats, including; GraphML, GXL, Graphlet, Pajek, TGF, DOT, DIMACS, Graph6, Sparse6, and LEDA. Import � "ExampleData � attributes.graphml", "Graph", VertexLabels � "Name", ImagePadding � 10 � n2 n4 n0 n5 n1 n3 Curated Graph in Mathematica Theoretical Graphs A wide variety of theoretical graphs, and their properties are available via the GraphData function

  10. 10 Wolfram-Technologies_Graph-Theory-Social-Networks.nb GraphData � "PappusGraph" � GraphData � "HeawoodGraph", "Properties" � �� Short � Acyclic, AdjacencyMatrix, AllImages, � 353 � , ZeroTwo, ZIndex � We can also make queries, like whether a graph belongs to a Class GraphData � "CubicalGraph", "Cage" � False Empirical Graphs ExampleData provides a wide catalogue of empirical graph data, including NetworkGraphs ExampleData � "NetworkGraph" � �� Short � � , 4 � & �� NetworkGraph, AmericanCollegeFootball � , � NetworkGraph, AskOpinionRecall � , � NetworkGraph, AskOpinionRecognition � , � 161 � , � NetworkGraph, WorldCup1988 � , � NetworkGraph, WorldWideWeb � , � NetworkGraph, ZacharyKarateClub �� ExampleData �� "NetworkGraph", "ZacharysKarateClub" �� Applying Graph Theory to Example Data Mathematica provides a wide range of curated data that are usefully visualised with Graph Theory,

  11. Wolfram-Technologies_Graph-Theory-Social-Networks.nb 11 AstronomicalData ElementData GraphData PolyhedronData ChemicalData FinancialData IsotopeData ProteinData CityData GenomeData KnotData WeatherData CountryData GeodesyData ParticleData WordData Graph � Flatten � Thread � � �� CountryData � � , "BorderingCountries" �� & � � CountryData � "SouthAmerica" �� , VertexShapeFunction � "Name" � Chile Argentina Bolivia Peru Ecuador Paraguay Uruguay Brazil Colombia Panama Venezuela FrenchGuiana Suriname Guyana | � �

  12. 12 Wolfram-Technologies_Graph-Theory-Social-Networks.nb Slide 5 of 9 Graph Theory Analytical Methods Graph Isomorphs, Complement, Difference and GraphDistributions Isomorphs Here we compute the isomorph that would convert a PetersenGraph, g � PetersenGraph � 4, 1, VertexLabels � "Name", ImagePadding � 10 � 8 4 7 3 1 5 2 6 into an equivalent CompleteGraph. v1 � � "a", "b", "c", "d" � ; v2 � � "e", "f", "g", "h" � ; edge � Table �� v1 �� i �� � � � & � � Delete � v2, 5 � i � , � i, 4 �� �� Flatten;

  13. Wolfram-Technologies_Graph-Theory-Social-Networks.nb 13 h � Graph � Join � v1, v2 � , edge, VertexLabels � "Name", ImagePadding � 10, VertexSize � Large, AbsoluteOptions � CompleteGraph �� 4, 4 �� , VertexCoordinates �� d h g c b f a e map � FindGraphIsomorphism � g, h � � 1 � a, 2 � e, 3 � b, 4 � f, 5 � g, 6 � c, 7 � h, 8 � d � a � First � � map; b � Last � � map; highlightGraph � g_, v_ � : � HighlightGraph � g, Table � Style � Labeled � v � i � , v � i �� , ColorData � "TemperatureMap" �� i � VertexCount � g ��� , � i, VertexCount � g ���� ; � highlightGraph � g, a � , highlightGraph � h, b �� 8 d h 4 g c � � 7 3 1 5 , b f 2 a e 6 Complement We can compute GraphComplements through the GraphComplement function. complementList � Table � CycleGraph � n, DirectedEdges � True, EdgeStyle � Arrowheads � 0.1 �� , � n, 4, 6 �� � � , , GraphComplement � � complementList � � , , Difference Graph differences may be computed easily through the GraphDifference function.

  14. 14 Wolfram-Technologies_Graph-Theory-Social-Networks.nb randGraph1 � RandomGraph �� 13, 14 � , VertexLabels � "Name", ImagePadding � 10 � 2 3 1 12 6 4 13 11 7 10 8 9 5 randGraph2 � RandomGraph �� 9, 10 � , VertexLabels � "Name", ImagePadding � 10 � 2 4 1 3 8 5 7 9 6 GraphDifference � randGraph1, randGraph2, VertexLabels � "Name", ImagePadding � 10 � 3 6 2 7 12 11 10 13 4 5 9

Recommend


More recommend