Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

random-geometric-graph

A demo of random geometric graphs

Introduction

In graph theory, a random geometric graph (RGG) is the mathematically simplest spatial network, namely an undirected graph constructed by randomly placing N nodes in some metric space (according to a specified probability distribution) and connecting two nodes by a link if and only if their distance is in a given range, e.g. smaller than a certain neighborhood radius, r.

See more from https://en.wikipedia.org/wiki/Random_geometric_graph.

Environment

  • Windows 10
  • MSYS2 64 bit 20200720
  • Qt Creator 4.12.4
  • openFrameworks Nightly Build (of_v20200818_msys2_mingw64)

Note: The original codes were developed back in 2013 on a Mac with a different version of openFrameworks. I figure it would be interesting to revisit the repo and migrate it to Windows. However, as of August 18, 2020, I couldn't make it work with the recent release (0.11.0) of openFrameworks. See Compilation failing due to confliting definition in openal. I ended up with a nightly build that comes with a fix. Check the following Setup section for details.

Demo

2D-RGG on a square

Features:

  • change neighbor radius (r) dynamically
  • change number of random nodes (n) dynamically
  • display edges between neighbors
  • display nodes with max/min neighbors

3D-RGG on a sphere

Features:

  • change neighbor radius (r) dynamically
  • change number of random nodes (n) dynamically
  • display edges between neighbors
  • display nodes with max/min neighbors
  • display sphere's 3d layout
  • drag and change the orientation of nodes
  • auto rotate with different speeds

Setup

  • Follow the instructions to install msys2 and Qt Creator.

  • Use Uncrustify to beautify the source codes. Download the latest release and place the executable in the PATH. Then follow instructions to configure Qt Creator.

  • Setup a new kit for msys2. According to this post, remember to configure MINGW_PREFIX and MSYSTEM. (I place msys2 in my user PATH instead of system PATH. Hence, I need to configure the PATH again.) See screenshot below.

  • Download the openFrameworks release and unzip it in a certain location. A new openFrameworks project shall be created in location's apps/myApps, since the default Makefile would rely on some other files in the related paths.

  • Finally make sure to choose the custom kit for the Qt project.

  • If addons are selected in the project creation wizard, remember to create a addons.make file and list the chosen addons inside.

About

A demo of random geometric graphs

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages