Showing posts with label Network Generation. Show all posts
Showing posts with label Network Generation. Show all posts

Monday, March 16, 2026

PySGN: A Python package for constructing synthetic geospatial networks

In previous posts, we have written about the generation of synthetic populations based on real world locations, and how such populations can have various types of networks associated with them. We have also written about network generation techniques in the past and keeping with this line of research, Boyu Wang, Taylor Anderson, Andreas Züfle and myself have a new paper in the Journal of Open Source Software entitled "PySGN: A Python Package for Constructing Synthetic Geospatial Networks"

In this paper we introduce a Python package that can generate geospatial networks which we have called PySGN (Python for Synthetic Geospatial Networks). For readers not familiar with geospatial networks, to quote from the online documentation we have put together:  

Geospatial networks are a type of network where nodes are associated with specific geographic locations. These networks are used to model and analyze spatial relationships and interactions, such as transportation systems, communication networks, and social interactions within geographic constraints. By incorporating spatial data, geospatial networks provide insights into how location influences connectivity and network dynamics.

PySGN generates synthetic geosocial networks that mimic the spatial relationships observed in real‑world networks as it embeds nodes in geographic coordinate space, modifies connection rules to decay with distance, and allows users to incorporate clustering and preferential attachment while respecting spatial constraints. Online we provide examples of creating Geospatial Erdős-Rényi, Watts-Strogatz & Barabási-Albert Networks along with ways to sample points based on a specified bounding box or specific polygon boundaries (examples of which are shown below). 

The package is intended for researchers and practitioners in fields such as urban planning, epidemiology, infrastructure resilience and social science who require robust tools for simulating and analyzing complex geospatial networks. In addition to the paper, we have also made available extensive documentation (along with examples of the various network types) at https://pysgn.readthedocs.io/en/ 

Examples of Geospatial Erdős-Rényi and Watts-Strogatz Networks.

Example of Geospatial Barabási-Albert Network based on different ordering strategies for how nodes are added to the network.

Examples of sampling points based on a bounding box or a specific set of polygons

Full Referece: 

Wang, B., Crooks, A.T., Anderson, T., and Züfle, A. (2026), PySGN: A Python Package for Constructing Synthetic Geospatial Networks. Journal of Open Source Software, 11(119), 9346, https://doi.org/10.21105/joss.09346 (pdf)

Monday, November 13, 2023

Synthetic Geosocial Network Generation

In the past the blog has explored the creation of social networks for models. Keeping with this vain of research, I was fortunate to work with Ketevan Gallagher, Taylor Anderson and Andreas Züfle to consider the role of location of individuals when generating social networks. This work has resulted in a new paper entitled "Synthetic Geosocial Network Data Generation"  which was presented at the 7th ACM SIGSPATIAL Workshop on Location-based Recommendations, Geosocial Networks and Geoadvertising (LocalRec 2023). If this sounds of interest, below you can read the abstract to the paper, see some the generated geosoical networks and find the full reference and link to the paper. In addition to this, the Python code and data used to generate the networks is available at https://github.com/KetevanGallagher/Synthetic-Geosocial-Networks.

Abstract: Generating synthetic social networks is an important task for many problems that study humans, their behavior, and their interactions. Geosocial networks enrich social networks with location information. Commonly used models to generate synthetic social networks include the classical Erdos-Renyi, Barabasi-Albert, and Watts-Strogatz models. However, these classic social network models do not consider the location of individuals. Real-world geosocial networks do exhibit a strong spatial autocorrelation, thus having a higher likelihood of a social connection between agents that are spatially close. As such, recent variants of the three classical models have been proposed to consider location information. Yet, these existing solutions assume that individuals are located on a uniform lattice and exhibit certain limitations when applied to real-world data that exhibits clusters. In this work, we discuss these limitations and propose new approaches to extend the three classic social network generation models to geosocial networks. Our experiments show that our generated synthetic geosocial networks address the shortcomings of the state-of-the-art models and generate realistic geosocial networks that exhibit high similarity to real-world geosocial networks. 
Keywords: Geosocial Networks, Network Generation, Synthetic Social Networks, Erdos-Renyi, Watts-Strogatz, Barabasi-Albert.


Real- World Geosocial Network using Facebook Social Connectedness Data between Zone Improvement Plan (ZIP) Region Centroids for the State of Virginia, USA.
Geosocial graphs using Virginia ZIP code data.
Graphs using Fairfax Census Tract data.


Full Referece:
Gallagher, K., Anderson, T., Crooks, A.T. and Züfle, A. (2023), Synthetic Geosocial Network Data Generation, Proceedings of the 7th ACM SIGSPATIAL Workshop on Location-based Recommendations, Geosocial Networks and Geoadvertising (LocalRec 2023), Hamburg, Germany. (pdf) (presentation)

Thursday, February 17, 2022

New Paper: Synthetic Populations with Social Networks

When developing geographically explicit agent-based models, one thing we spend a lot of time on is building synthetic populations and then linking the agents in the synthetic population to each other.  To overcome this issue we have a new paper published in "Computational Urban Science " entitled "A method to create a synthetic population with social networks for geographically-explicit agent-based models" In this paper  Na (Richard) Jiang, Hamdi Kavak, Annetta Burger, William Kennedy and myself present a synthetic population generation method that also includes social networks and use the New York Metro as a study site, which covers an area of 262 x 234 km and is home to over 23 million people. 

To show the utility of this method we also present three simple applications (e.g., a disease , a disaster  and a traffic model) which utilize different parts of this synthetic population but are all geographically explicit and use networks in some shape or form. If this sounds of interest, below you can read the abstract from the paper, along with seeing some of the figures from our methodology and example applications. While at the bottom of the post we provide the full citation and a link to the paper. The paper itself also has links to actual code that generates the synthetic population and the resulting datasets and models  (code: https://bit.ly/SynPopABM; source and resulting synthetic population data: https://osf.io/3vsaj/) .  

Abstract: 

Geographically-explicit simulations have become crucial in understanding cities and are playing an important role in urban science. One such approach is that of agent-based modeling which allows us to explore how agents interact with the environment and each other (e.g., social networks), and how through such interactions aggregate patterns emerge (e.g., disease outbreaks, traffic jams). While the use of agent-based modeling has grown, one challenge remains, that of creating realistic, geographically-explicit, synthetic populations which incorporate social networks. To address this challenge, this paper presents a novel method to create a synthetic population which incorporates social networks using the New York Metro Area as a test area. To demonstrate the generalizability of our synthetic population method and data to initialize models, three different types of agent-based models are introduced to explore a variety of urban problems: traffic, disaster response, and the spread of disease. These use cases not only demonstrate how our geographically-explicit synthetic population can be easily utilized for initializing agent populations which can explore a variety of urban problems, but also show how social networks can be integrated into such populations and large-scale simulations.

Keywords: Synthetic Population Generation, Agent-Based Modeling, New York, Traffic Dynamics, Disease, Disaster

Study Area

Workflow for Generation of Synthetic Population and Networks

Creation of Social Networks: (a) Selected Population; (b) Creation of a Household Network; (c) Creation of Work and Educational Networks for each Member of the Household; (d) The Household, its Networks within the Full Census Tract

Model Component Structure of Population Respond to Disaster event

Agents’ Health Status After 1 Minute of the Disaster Event

Full Reference:

Jiang, N., Crooks, A.T., Kavak, H., Burger, A. and Kennedy, W.G. (2022), A Method to Create a Synthetic Population with Social Networks for Geographically Explicit Agent-Based Models, Computational Urban Science, 2:7. Available at https://doi.org/10.1007/s43762-022-00034-1

Wednesday, June 30, 2021

Towards Large-Scale Agent-Based Geospatial Simulation

Running large scale spatial agent-based models is often a computational challenge. To address this challenge, at the upcoming International Conference on Social Computing, Behavioral-Cultural Modeling and Prediction and Behavior Representation in Modeling and Simulation (or SBP-BRiMS for short), Umar Manzoor, Hamdi Kavak, Joon-Seok Kim, Dieter Pfoser, Andreas Zufle, and Carola Wenk and myself have a paper entitled "Towards Large-Scale Agent-Based Geospatial Simulation."

In the paper we propose a scalable and general agent-based modeling and simulation framework for geospatial simulations involving networks. Specifically we propose to a solution for the parallelization of the single-threaded GeoMASON tookit by employing the Java Agent Development Environment (JADE) for the communication between threads (essentially, we divide the space of our agents into partitions, each handled by a separate thread of execution). We evaluate the proposed framework an simple urban model (created in MASON), which simulates simple patterns of life within an urban setting (click here for the blog post). The model has spatial network for agent movement and social network for maintaining social links. We compared the performance of the proposed framework on different settings, and concluded from experimentation that the proposed framework is outperformed by GeoMason when the agent population is small whereas with an increasing agent population, our proposed framework outperforms GeoMason as the complexity and time taken in simulation step increases substantially. If this sounds of interest, below we provide the abstract to the paper, along with some images of the framework and and simulation architecture. At the bottom of the page you can find the full citation and a link to the paper.

Abstract. Agent-based geospatial simulations have become very popular and widely used in examining the social and cultural characteristics of populations. Well-known toolkits such as NetLogo or MASON generally have scalability limitations, especially when the model and underlying spatial infrastructure become complex. This paper presents a framework for simulating large-scale agent-based geospatial systems by integrating the multi-agent systems toolkit JADE with the MASON agent-based modeling framework and its GIS extension, GeoMASON. The proposed Java-based framework can simulate large areas with hundreds of thousands of agents. It allows for the studying the evolution of a population and its environment over time. Such a framework provides the essential first steps for scalable model execution without sacrificing the model generality. 

Keywords: Large-scale geospatial simulation, Agent-based Modeling, MASON, Jade, GIS.

System Architecture of Proposed Framework.
Agent transfer between Zones.
Simulation using Proposed Architecture.

Full Reference:

Manzoor, U., Kavak, H., Kim, J-S., Crooks, A.T., Pfoser, D., Zufle, A. and Wenk, C. (2021), Towards Large-Scale Agent-Based Geospatial Simulation, 2021 International Conference on Social Computing, Behavioral-Cultural Modeling and Prediction and Behavior Representation in Modeling and Simulation, Washington DC. (pdf)

Tuesday, November 03, 2020

Integrating Social Networks into Large-scale Urban Simulations

Building on past posts about our work with respect to generating large scale synthetic populations for agent-based models, we have a new paper entitled "Integrating Social Networks into Large-scale Urban Simulations for Disaster Responses" that was accepted at the 3rd ACM SIGSPATIAL International Workshop on GeoSpatial Simulation. In the paper we discuss our method to create synthetic populations  which incorporates social networks to generate for the New York megacity region. To demonstrate the utility of our approach, we use the generated synthetic population to initialize an agent-based model which not only generates basic patterns of life (e.g., commuting to and from work), but also allows us to explore how people react to disasters and how their social networks are changed by such events. 

If sounds of interest to you, below we provide the abstract to the paper, along with our synthetic population workflow and some sample outcomes from the model. At the bottom of the post we provide the full reference and link to the paper (the paper itself also links to a GitHub repository where more information about the synesthetic population can be found).

ABSTRACT: Social connections between people influence how they behave and where they go; however, such networks are rarely incorporated in agent-based models of disaster. To address this, we introduce a novel synthetic population method which specifically creates social relationships. This synthetic population is then used to instantiate a geographically explicit agent-based model for the New York megacity region which captures pre- and post- disaster behaviors. We demonstrate not only how social networks can be incorporated into models of disaster but also how such networks can impact decision making, opening up a variety of new application areas where network structures matter in urban settings. 

KEYWORDS: Urban Simulation, Agent-based models, Synthetic Populations, Social Networks, Geographical Information Systems, Disasters.

Synthetic population and social network generation workflow.
Synthetic population at household level within a census track (A) and social network of one individual (B).
Example of a heat-map of traffic density (A) Manhattan is center of the plot. The impact area of the disaster and the health status of the agents (B).

Full Reference:

Jiang, N., Burger, A., Crooks, A.T. and Kennedy, W.G. (2020), Integrating Social Networks into Large-scale Urban Simulations for Disaster Responses. Geosim ’20: 3rd ACM SIGSPATIAL International Workshop on GeoSpatial Simulation, Seattle, WA. (pdf)

Thursday, April 30, 2020

Exploring the Effects of Link Recommendations on Social Networks


Most people today are actively engaged on at least one social networking site, enabling individuals to keep in touch with old friends, connect with new people, and rapidly disseminate information to all. The method by which users find and link up with others online is often assisted by recommendation systems. A common technique utilized by online social networking sites (e.g., LinkedIn, Facebook) is to make link recommendations based upon friends of friends, or shared mutual connections. This method exploits a user’s social network structure, and specifically transitivity, to predict that a user will be interested in connecting with an individual who is also connected with that user’s friends, (i.e., “I am more likely to like someone who several of my friends like, than someone chosen at random”).

Despite the wide use of recommendation algorithms, little is known about the way in which recommendation systems impact the structure of online social networks. To address this problem at the upcoming (now virtual) 2020 Spring Simulation Conference we have a paper entitled "Exploring the Effects of Link Recommendations on Social Networks: An Agent-Based Modeling Approach."

This paper contributes to this limited area of (publicly available) research by demonstrating how a stylized agent-based model can be used to explore societal, network-level effects of commonly used online link recommendations from the bottom up. Below we provide the abstract to the paper, the steps the model takes to generate the online social network, the types of metrics outputted by the model and a selection of some of the results. While at the bottom of the post we provide the full reference to the paper. Further details about the model, in the Overview, Design Concepts, and Details (ODD) format along with the Python source code can be found at https://www.comses.net/codebase-release/3203a44a-fcb0-4957-a3b7-8323f829c0c4/. 

Abstract:
The vast majority of recommender system research has focused on improving performance accuracy, while limited work has explored their societal, network level effects. This paper demonstrates how simulation can be used to investigate macro level effects of online social network link recommendations, such as whether these technologies may be fragmenting or bridging communities of individuals. An agent-based model is presented that generates stylized online social networks with different percentages of real world contacts and link recommendations. Results show that networks with higher percentages of recommendation-based links produce more clustered, distinct, and dispersed communities, suggesting that these technologies could fragment society. Furthermore, scale-free network properties diminished with higher percentages of recommendations, suggesting that these technologies could be contributing to recent findings that social networks are at most ‘weakly’ scale-free. Building upon this research, further simulation work could inform the design of link recommendation algorithms that help connect both individuals and communities.

Keywords: online social network, social network analysis, mutual connection link recommendation system, friend-of-friend recommender, agent-based modeling.
Online network generation process
Social Network Analysis definitions for metrics output by this model
The effect of link recommendations on mean clustering coefficient and modularity. Error bars represent one standard deviation.
Probability density functions showing the degree distribution of Online networks (beginning top left and increasing left to right, top to bottom) with link recommendation percentage levels: 0, 10, 20, 30, 40, and 50. The blue line represents the empirical data, and red and green dotted lines represent fit lines corresponding with the power-law and lognormal distributions, respectively.

Full Reference: 
Sibley, C. and Crooks, A.T. (2020), Exploring the Effects of Link Recommendations on Social Networks: An Agent-Based Modeling Approach, Spring Simulation Conference (SpringSim’20), Fairfax, VA. (pdf)

Update: Our paper was selected as runner-up for best paper.

Saturday, October 07, 2017

Generation of Realistic Mega-City Populations and Social Networks for ABM


At the upcoming 2017 Annual conference of the Computational Social Science Society of the Americas, Annetta Burger, Talha Oz, William Kennedy and myself have a paper entitled: "Generation of Realistic Mega-City Populations and Social Networks for Agent-Based Modeling". 

In the paper we discuss some of our current work of generating synthetic human populations with realistic social networks with respect to the New York mega-city and surrounding region. Below you can read the abstract of the paper and see our workflow along with some initial results. The full reference to the paper and a link to the pdf can be found at the bottom of the post.


Abstract:
Agent-based modeling is a means for researchers to conduct large-scale computer experiments on synthetic human populations and study their behaviors under different conditions. These models have been applied to questions regarding disease spread in epidemiology, terrorist and criminal activity in sociology, and traffic and commuting patterns in urban studies. However, developing realistic control populations remains a key challenge for the research and experimentation. Modelers must balance the need for representative, heterogeneous populations with the computational costs of developing large population sets. Increasingly these models also need to include the social network relationships within populations that influence social interactions and behavioral patterns. To address this we used a mixed method of iterative proportional fitting and network generation to build a synthesized subset population of the New York megacity and region. Our approach demonstrates how a robust population and social network relevant to specific human behavior can be synthesized for agent-based models. 

Keywords: Agent-based Models, Geographical Systems, Population Synthesis, Social Networks, Megacity.





Full Reference: 
Burger, A., Oz, T., Crooks, A.T. and Kennedy, W.G. (2017). Generation of Realistic Mega-City Populations and Social Networks for Agent-Based Modeling, The Computational Social Science Society of Americas Conference, Santa Fe, NM. (pdf)


Saturday, September 03, 2016

New Paper: Generating and Analyzing Spatial Social Networks


We recently had a paper entitled "Generating and Analyzing Spatial Social Networks" accepted in Computational and Mathematical Organization Theory. In the paper we proposed and explored spatial versions of three well known networks, that of the Erdös-Rényi, Watts-Strogatz, and Barabási-Albert. Further details about the paper can be seen in the abstract below:
"In this paper, we propose a class of models for generating spatial versions of three classic networks: Erdös-Rényi (ER), Watts-Strogatz (WS), and Barabási-Albert (BA). We assume that nodes have geographical coordinates, are uniformly distributed over an m × m Cartesian space, and long-distance connections are penalized. Our computational results show higher clustering coefficient, assortativity, and transitivity in all three spatial networks, and imperfect power law degree distribution in the BA network. Furthermore, we analyze a special case with geographically clustered coordinates, resembling real human communities, in which points are clustered over k centers. Comparison between the uniformly and geographically clustered versions of the proposed spatial networks show an increase in values of the clustering coefficient, assortativity, and transitivity, and a lognormal degree distribution for spatially clustered ER, taller degree distribution and higher average path length for spatially clustered WS, and higher clustering coefficient and transitivity for the spatially clustered BA networks."
Keywords: Spatial social networks, Network properties, Random network, Small-world network, Scale-free network.



The Python code for the models can be found here.


Full Reference: 
Alizadeh, M., Cioffi-Revilla, C. and Crooks, A. (2017), Generating and Analyzing Spatial Social Networks. Computational and Mathematical Organization Theory, 23(3): 362-390. (pdf)