helios.layouts.forceatlas2gpu.ForceAtlas2

class helios.layouts.forceatlas2gpu.ForceAtlas2(edges, network_draw, weights=None, lin_log_mode=False, edge_weight_influence=1.0, jitter_tolerance=1.0, barnes_hut_optimize=True, barnes_hut_theta=1.0, scaling_ratio=2.0, strong_gravity_mode=False, gravity=1.0)[source]

Bases: helios.layouts.base.NetworkLayoutIPCRender

Performs the ForceAtlas2 algorithm using the cugraph lib.

The ForceAtlas will be called inside of a different process which comunicates with this object through the SharedMemory

Notes

Python 3.8+ is required to use this

Parameters
  • edges (ndarray) –

  • network_draw (NetworkDraw) –

  • weights (array, optional) – edge weights

  • lin_log_mode (bool, default False) –

  • edge_weight_influence (float, default 1.0) –

  • jitter_tolerance (float, default 1.0) –

  • barnes_hut_optimize (bool, default True) –

  • barnes_hut_theta (float, default 1.0) –

  • scaling_ratio (float, default 2.0) –

  • strong_gravity_mode (bool, default False) –

  • gravity (float, default 1.0) –

Methods

cleanup

Release the shared memory resources

start

This method starts the network layout algorithm creating a new subprocess.

stop

Stop the layout algorithm

update

This method updates the position of the network actor and right after that refresh the network draw

cleanup()

Release the shared memory resources

start(ms=30, steps=100, iters_by_step=2, record_positions=False, without_iren_start=True)

This method starts the network layout algorithm creating a new subprocess.

Right after the network layout algorithm finish the computation (ending of the related subprocess), the stop method will be called automatically.

Parameters
  • ms (float) – time interval in milleseconds to update the positions inside of the NetworkDraw

  • steps (int) – number of steps; snapshots. For example, if you set steps=3 that means the positions will be updated three times.

  • iters_by_step (int) – number of interations in each step

  • record_positions (bool, optional, default True) – Record the positions of the network

  • without_iren_start (bool, optional, default True) – Set this to False if you will start the ShowManager. That is, if you will invoke the following commands

Examples

>>> network_draw.initialize()
>>> network_draw.start()
stop()

Stop the layout algorithm

update()

This method updates the position of the network actor and right after that refresh the network draw