Exploring Network Structure, Dynamics, and Function Using Networkx
Total Page:16
File Type:pdf, Size:1020Kb
Load more
Recommended publications
-
Sagemath and Sagemathcloud
Viviane Pons Ma^ıtrede conf´erence,Universit´eParis-Sud Orsay [email protected] { @PyViv SageMath and SageMathCloud Introduction SageMath SageMath is a free open source mathematics software I Created in 2005 by William Stein. I http://www.sagemath.org/ I Mission: Creating a viable free open source alternative to Magma, Maple, Mathematica and Matlab. Viviane Pons (U-PSud) SageMath and SageMathCloud October 19, 2016 2 / 7 SageMath Source and language I the main language of Sage is python (but there are many other source languages: cython, C, C++, fortran) I the source is distributed under the GPL licence. Viviane Pons (U-PSud) SageMath and SageMathCloud October 19, 2016 3 / 7 SageMath Sage and libraries One of the original purpose of Sage was to put together the many existent open source mathematics software programs: Atlas, GAP, GMP, Linbox, Maxima, MPFR, PARI/GP, NetworkX, NTL, Numpy/Scipy, Singular, Symmetrica,... Sage is all-inclusive: it installs all those libraries and gives you a common python-based interface to work on them. On top of it is the python / cython Sage library it-self. Viviane Pons (U-PSud) SageMath and SageMathCloud October 19, 2016 4 / 7 SageMath Sage and libraries I You can use a library explicitly: sage: n = gap(20062006) sage: type(n) <c l a s s 'sage. interfaces .gap.GapElement'> sage: n.Factors() [ 2, 17, 59, 73, 137 ] I But also, many of Sage computation are done through those libraries without necessarily telling you: sage: G = PermutationGroup([[(1,2,3),(4,5)],[(3,4)]]) sage : G . g a p () Group( [ (3,4), (1,2,3)(4,5) ] ) Viviane Pons (U-PSud) SageMath and SageMathCloud October 19, 2016 5 / 7 SageMath Development model Development model I Sage is developed by researchers for researchers: the original philosophy is to develop what you need for your research and share it with the community. -
Networkx Tutorial
5.03.2020 tutorial NetworkX tutorial Source: https://github.com/networkx/notebooks (https://github.com/networkx/notebooks) Minor corrections: JS, 27.02.2019 Creating a graph Create an empty graph with no nodes and no edges. In [1]: import networkx as nx In [2]: G = nx.Graph() By definition, a Graph is a collection of nodes (vertices) along with identified pairs of nodes (called edges, links, etc). In NetworkX, nodes can be any hashable object e.g. a text string, an image, an XML object, another Graph, a customized node object, etc. (Note: Python's None object should not be used as a node as it determines whether optional function arguments have been assigned in many functions.) Nodes The graph G can be grown in several ways. NetworkX includes many graph generator functions and facilities to read and write graphs in many formats. To get started though we'll look at simple manipulations. You can add one node at a time, In [3]: G.add_node(1) add a list of nodes, In [4]: G.add_nodes_from([2, 3]) or add any nbunch of nodes. An nbunch is any iterable container of nodes that is not itself a node in the graph. (e.g. a list, set, graph, file, etc..) In [5]: H = nx.path_graph(10) file:///home/szwabin/Dropbox/Praca/Zajecia/Diffusion/Lectures/1_intro/networkx_tutorial/tutorial.html 1/18 5.03.2020 tutorial In [6]: G.add_nodes_from(H) Note that G now contains the nodes of H as nodes of G. In contrast, you could use the graph H as a node in G. -
Networkx: Network Analysis with Python
NetworkX: Network Analysis with Python Salvatore Scellato Full tutorial presented at the XXX SunBelt Conference “NetworkX introduction: Hacking social networks using the Python programming language” by Aric Hagberg & Drew Conway Outline 1. Introduction to NetworkX 2. Getting started with Python and NetworkX 3. Basic network analysis 4. Writing your own code 5. You are ready for your project! 1. Introduction to NetworkX. Introduction to NetworkX - network analysis Vast amounts of network data are being generated and collected • Sociology: web pages, mobile phones, social networks • Technology: Internet routers, vehicular flows, power grids How can we analyze this networks? Introduction to NetworkX - Python awesomeness Introduction to NetworkX “Python package for the creation, manipulation and study of the structure, dynamics and functions of complex networks.” • Data structures for representing many types of networks, or graphs • Nodes can be any (hashable) Python object, edges can contain arbitrary data • Flexibility ideal for representing networks found in many different fields • Easy to install on multiple platforms • Online up-to-date documentation • First public release in April 2005 Introduction to NetworkX - design requirements • Tool to study the structure and dynamics of social, biological, and infrastructure networks • Ease-of-use and rapid development in a collaborative, multidisciplinary environment • Easy to learn, easy to teach • Open-source tool base that can easily grow in a multidisciplinary environment with non-expert users -
A Network Approach of the Mandatory Influenza Vaccination Among Healthcare Workers
Wright State University CORE Scholar Master of Public Health Program Student Publications Master of Public Health Program 2014 Best Practices: A Network Approach of the Mandatory Influenza Vaccination Among Healthcare Workers Greg Attenweiler Wright State University - Main Campus Angie Thomure Wright State University - Main Campus Follow this and additional works at: https://corescholar.libraries.wright.edu/mph Part of the Influenza Virus accinesV Commons Repository Citation Attenweiler, G., & Thomure, A. (2014). Best Practices: A Network Approach of the Mandatory Influenza Vaccination Among Healthcare Workers. Wright State University, Dayton, Ohio. This Master's Culminating Experience is brought to you for free and open access by the Master of Public Health Program at CORE Scholar. It has been accepted for inclusion in Master of Public Health Program Student Publications by an authorized administrator of CORE Scholar. For more information, please contact library- [email protected]. Running Head: A NETWORK APPROACH 1 Best Practices: A network approach of the mandatory influenza vaccination among healthcare workers Greg Attenweiler Angie Thomure Wright State University A NETWORK APPROACH 2 Acknowledgements We would like to thank Michele Battle-Fisher and Nikki Rogers for donating their time and resources to help us complete our Culminating Experience. We would also like to thank Michele Battle-Fisher for creating the simulation used in our Culmination Experience. Finally we would like to thank our family and friends for all of the -
Introduction to Network Science & Visualisation
IFC – Bank Indonesia International Workshop and Seminar on “Big Data for Central Bank Policies / Building Pathways for Policy Making with Big Data” Bali, Indonesia, 23-26 July 2018 Introduction to network science & visualisation1 Kimmo Soramäki, Financial Network Analytics 1 This presentation was prepared for the meeting. The views expressed are those of the author and do not necessarily reflect the views of the BIS, the IFC or the central banks and other institutions represented at the meeting. FNA FNA Introduction to Network Science & Visualization I Dr. Kimmo Soramäki Founder & CEO, FNA www.fna.fi Agenda Network Science ● Introduction ● Key concepts Exposure Networks ● OTC Derivatives ● CCP Interconnectedness Correlation Networks ● Housing Bubble and Crisis ● US Presidential Election Network Science and Graphs Analytics Is already powering the best known AI applications Knowledge Social Product Economic Knowledge Payment Graph Graph Graph Graph Graph Graph Network Science and Graphs Analytics “Goldman Sachs takes a DIY approach to graph analytics” For enhanced compliance and fraud detection (www.TechTarget.com, Mar 2015). “PayPal relies on graph techniques to perform sophisticated fraud detection” Saving them more than $700 million and enabling them to perform predictive fraud analysis, according to the IDC (www.globalbankingandfinance.com, Jan 2016) "Network diagnostics .. may displace atomised metrics such as VaR” Regulators are increasing using network science for financial stability analysis. (Andy Haldane, Bank of England Executive -
Graph Database Fundamental Services
Bachelor Project Czech Technical University in Prague Faculty of Electrical Engineering F3 Department of Cybernetics Graph Database Fundamental Services Tomáš Roun Supervisor: RNDr. Marko Genyk-Berezovskyj Field of study: Open Informatics Subfield: Computer and Informatic Science May 2018 ii Acknowledgements Declaration I would like to thank my advisor RNDr. I declare that the presented work was de- Marko Genyk-Berezovskyj for his guid- veloped independently and that I have ance and advice. I would also like to thank listed all sources of information used Sergej Kurbanov and Herbert Ullrich for within it in accordance with the methodi- their help and contributions to the project. cal instructions for observing the ethical Special thanks go to my family for their principles in the preparation of university never-ending support. theses. Prague, date ............................ ........................................... signature iii Abstract Abstrakt The goal of this thesis is to provide an Cílem této práce je vyvinout webovou easy-to-use web service offering a database službu nabízející databázi neorientova- of undirected graphs that can be searched ných grafů, kterou bude možno efektivně based on the graph properties. In addi- prohledávat na základě vlastností grafů. tion, it should also allow to compute prop- Tato služba zároveň umožní vypočítávat erties of user-supplied graphs with the grafové vlastnosti pro grafy zadané uži- help graph libraries and generate graph vatelem s pomocí grafových knihoven a images. Last but not least, we implement zobrazovat obrázky grafů. V neposlední a system that allows bulk adding of new řadě je také cílem navrhnout systém na graphs to the database and computing hromadné přidávání grafů do databáze a their properties. -
A Centrality Measure for Electrical Networks
Carnegie Mellon Electricity Industry Center Working Paper CEIC-07 www.cmu.edu/electricity 1 A Centrality Measure for Electrical Networks Paul Hines and Seth Blumsack types of failures. Many classifications of network structures Abstract—We derive a measure of “electrical centrality” for have been studied in the field of complex systems, statistical AC power networks, which describes the structure of the mechanics, and social networking [5,6], as shown in Figure 2, network as a function of its electrical topology rather than its but the two most fruitful and relevant have been the random physical topology. We compare our centrality measure to network model of Erdös and Renyi [7] and the “small world” conventional measures of network structure using the IEEE 300- bus network. We find that when measured electrically, power model inspired by the analyses in [8] and [9]. In the random networks appear to have a scale-free network structure. Thus, network model, nodes and edges are connected randomly. The unlike previous studies of the structure of power grids, we find small-world network is defined largely by relatively short that power networks have a number of highly-connected “hub” average path lengths between node pairs, even for very large buses. This result, and the structure of power networks in networks. One particularly important class of small-world general, is likely to have important implications for the reliability networks is the so-called “scale-free” network [10, 11], which and security of power networks. is characterized by a more heterogeneous connectivity. In a Index Terms—Scale-Free Networks, Connectivity, Cascading scale-free network, most nodes are connected to only a few Failures, Network Structure others, but a few nodes (known as hubs) are highly connected to the rest of the network. -
Networkx Reference Release 1.9.1
NetworkX Reference Release 1.9.1 Aric Hagberg, Dan Schult, Pieter Swart September 20, 2014 CONTENTS 1 Overview 1 1.1 Who uses NetworkX?..........................................1 1.2 Goals...................................................1 1.3 The Python programming language...................................1 1.4 Free software...............................................2 1.5 History..................................................2 2 Introduction 3 2.1 NetworkX Basics.............................................3 2.2 Nodes and Edges.............................................4 3 Graph types 9 3.1 Which graph class should I use?.....................................9 3.2 Basic graph types.............................................9 4 Algorithms 127 4.1 Approximation.............................................. 127 4.2 Assortativity............................................... 132 4.3 Bipartite................................................. 141 4.4 Blockmodeling.............................................. 161 4.5 Boundary................................................. 162 4.6 Centrality................................................. 163 4.7 Chordal.................................................. 184 4.8 Clique.................................................. 187 4.9 Clustering................................................ 190 4.10 Communities............................................... 193 4.11 Components............................................... 194 4.12 Connectivity.............................................. -
Network Biology. Applications in Medicine and Biotechnology [Verkkobiologia
Dissertation VTT PUBLICATIONS 774 Erno Lindfors Network Biology Applications in medicine and biotechnology VTT PUBLICATIONS 774 Network Biology Applications in medicine and biotechnology Erno Lindfors Department of Biomedical Engineering and Computational Science Doctoral dissertation for the degree of Doctor of Science in Technology to be presented with due permission of the Aalto Doctoral Programme in Science, The Aalto University School of Science and Technology, for public examination and debate in Auditorium Y124 at Aalto University (E-hall, Otakaari 1, Espoo, Finland) on the 4th of November, 2011 at 12 noon. ISBN 978-951-38-7758-3 (soft back ed.) ISSN 1235-0621 (soft back ed.) ISBN 978-951-38-7759-0 (URL: http://www.vtt.fi/publications/index.jsp) ISSN 1455-0849 (URL: http://www.vtt.fi/publications/index.jsp) Copyright © VTT 2011 JULKAISIJA – UTGIVARE – PUBLISHER VTT, Vuorimiehentie 5, PL 1000, 02044 VTT puh. vaihde 020 722 111, faksi 020 722 4374 VTT, Bergsmansvägen 5, PB 1000, 02044 VTT tel. växel 020 722 111, fax 020 722 4374 VTT Technical Research Centre of Finland, Vuorimiehentie 5, P.O. Box 1000, FI-02044 VTT, Finland phone internat. +358 20 722 111, fax + 358 20 722 4374 Technical editing Marika Leppilahti Kopijyvä Oy, Kuopio 2011 Erno Lindfors. Network Biology. Applications in medicine and biotechnology [Verkkobiologia. Lääke- tieteellisiä ja bioteknisiä sovelluksia]. Espoo 2011. VTT Publications 774. 81 p. + app. 100 p. Keywords network biology, s ystems b iology, biological d ata visualization, t ype 1 di abetes, oxida- tive stress, graph theory, network topology, ubiquitous complex network properties Abstract The concept of systems biology emerged over the last decade in order to address advances in experimental techniques. -
Network Analysis with Nodexl
Social data: Advanced Methods – Social (Media) Network Analysis with NodeXL A project from the Social Media Research Foundation: http://www.smrfoundation.org About Me Introductions Marc A. Smith Chief Social Scientist Connected Action Consulting Group [email protected] http://www.connectedaction.net http://www.codeplex.com/nodexl http://www.twitter.com/marc_smith http://delicious.com/marc_smith/Paper http://www.flickr.com/photos/marc_smith http://www.facebook.com/marc.smith.sociologist http://www.linkedin.com/in/marcasmith http://www.slideshare.net/Marc_A_Smith http://www.smrfoundation.org http://www.flickr.com/photos/library_of_congress/3295494976/sizes/o/in/photostream/ http://www.flickr.com/photos/amycgx/3119640267/ Collaboration networks are social networks SNA 101 • Node A – “actor” on which relationships act; 1-mode versus 2-mode networks • Edge B – Relationship connecting nodes; can be directional C • Cohesive Sub-Group – Well-connected group; clique; cluster A B D E • Key Metrics – Centrality (group or individual measure) D • Number of direct connections that individuals have with others in the group (usually look at incoming connections only) E • Measure at the individual node or group level – Cohesion (group measure) • Ease with which a network can connect • Aggregate measure of shortest path between each node pair at network level reflects average distance – Density (group measure) • Robustness of the network • Number of connections that exist in the group out of 100% possible – Betweenness (individual measure) F G • -
A Sharp Pagerank Algorithm with Applications to Edge Ranking and Graph Sparsification
A sharp PageRank algorithm with applications to edge ranking and graph sparsification Fan Chung? and Wenbo Zhao University of California, San Diego La Jolla, CA 92093 ffan,[email protected] Abstract. We give an improved algorithm for computing personalized PageRank vectors with tight error bounds which can be as small as O(n−k) for any fixed positive integer k. The improved PageRank algorithm is crucial for computing a quantitative ranking for edges in a given graph. We will use the edge ranking to examine two interrelated problems — graph sparsification and graph partitioning. We can combine the graph sparsification and the partitioning algorithms using PageRank vectors to derive an improved partitioning algorithm. 1 Introduction PageRank, which was first introduced by Brin and Page [11], is at the heart of Google’s web searching algorithms. Originally, PageRank was defined for the Web graph (which has all webpages as vertices and hy- perlinks as edges). For any given graph, PageRank is well-defined and can be used for capturing quantitative correlations between pairs of vertices as well as pairs of subsets of vertices. In addition, PageRank vectors can be efficiently computed and approximated (see [3, 4, 10, 22, 26]). The running time of the approximation algorithm in [3] for computing a PageRank vector within an error bound of is basically O(1/)). For the problems that we will examine in this paper, it is quite crucial to have a sharper error bound for PageRank. In Section 2, we will give an improved approximation algorithm with running time O(m log(1/)) to compute PageRank vectors within an error bound of . -
The Pagerank Algorithm Is One Way of Ranking the Nodes in a Graph by Importance
The PageRank 13 Algorithm Lab Objective: Many real-world systemsthe internet, transportation grids, social media, and so oncan be represented as graphs (networks). The PageRank algorithm is one way of ranking the nodes in a graph by importance. Though it is a relatively simple algorithm, the idea gave birth to the Google search engine in 1998 and has shaped much of the information age since then. In this lab we implement the PageRank algorithm with a few dierent approaches, then use it to rank the nodes of a few dierent networks. The PageRank Model The internet is a collection of webpages, each of which may have a hyperlink to any other page. One possible model for a set of n webpages is a directed graph, where each node represents a page and node j points to node i if page j links to page i. The corresponding adjacency matrix A satises Aij = 1 if node j links to node i and Aij = 0 otherwise. b c abcd a 2 0 0 0 0 3 b 6 1 0 1 0 7 A = 6 7 c 4 1 0 0 1 5 d 1 0 1 0 a d Figure 13.1: A directed unweighted graph with four nodes, together with its adjacency matrix. Note that the column for node b is all zeros, indicating that b is a sinka node that doesn't point to any other node. If n users start on random pages in the network and click on a link every 5 minutes, which page in the network will have the most views after an hour? Which will have the fewest? The goal of the PageRank algorithm is to solve this problem in general, therefore determining how important each webpage is.