Layout#

Functions

cugraph_error_code_t cugraph_force_atlas2(
const cugraph_resource_handle_t *handle,
cugraph_rng_state_t *rng_state,
cugraph_graph_t *graph,
int max_iter,
cugraph_type_erased_device_array_view_t *start_vertices,
cugraph_type_erased_device_array_view_t *x_start,
cugraph_type_erased_device_array_view_t *y_start,
bool_t outbound_attraction_distribution,
bool_t lin_log_mode,
bool_t prevent_overlapping,
cugraph_type_erased_device_array_view_t *vertex_radius_vertices,
cugraph_type_erased_device_array_view_t *vertex_radius_values,
double overlap_scaling_ratio,
double edge_weight_influence,
double jitter_tolerance,
bool_t barnes_hut_optimize,
double barnes_hut_theta,
double scaling_ratio,
bool_t strong_gravity_mode,
double gravity,
cugraph_type_erased_device_array_view_t *vertex_mobility_vertices,
cugraph_type_erased_device_array_view_t *vertex_mobility_values,
cugraph_type_erased_device_array_view_t *vertex_mass_vertices,
cugraph_type_erased_device_array_view_t *vertex_mass_values,
bool_t verbose,
bool_t do_expensive_check,
cugraph_layout_result_t **result,
cugraph_error_t **error
)#

Force Atlas 2.

NOTE: This currently wraps the legacy force atlas 2 implementation and is only available in Single GPU implementation.

Parameters:
  • handle[in] Handle for accessing resources

  • rng_state[inout] State of the random number generator, updated with each call

  • graph[in] Pointer to graph. NOTE: Graph might be modified if the storage needs to be transposed

  • max_iter[in] Maximum number of iterations. Initial vertex positioning

  • start_vertices[in] Optionally send in an initial vertex positioning. This defines the vertices for x_start and y_start.

  • x_start[in] Optionally send in an initial vertex positioning (x-axis). Set to NULL if no value is passed. If NULL, the initial x-axis are selected randomly.

  • y_start[in] Optionally send in an initial vertex positioning (y-axis). Set to NULL if no value is passed. If NULL, the initial y-axis are selected randomly.

  • outbound_attraction_distribution[in] Distributes attraction along outbound edges Hubs attract less and thus are pushed to the borders.

  • lin_log_mode[in] Switch Force Atlas model from lin-lin to lin-log. Makes clusters more tight.

  • prevent_overlapping[in] Prevent nodes to overlap.

  • vertex_radius_vertices[in] Vertex identities for vertex radius.

  • vertex_radius_values[in] Radius of each vertex, used when prevent_overlapping is set.

  • overlap_scaling_ratio[in] When prevent_overlapping is set, scales the repulsion force between two nodes that are overlapping.

  • edge_weight_influence[in] How much influence you give to the edges weight. 0 is “no influence” and 1 is “normal”.

  • jitter_tolerance[in] How much swinging you allow. Above 1 discouraged. Lower gives less speed and more precision.

  • barnes_hut_optimize[in] Whether to use the Barnes Hut approximation or the slower exact version.

  • barnes_hut_theta[in] Float between 0 and 1. Tradeoff for speed (1) vs accuracy (0) for Barnes Hut only.

  • scaling_ratio[in] How much repulsion you want. More makes a more sparse graph. Switching from regular mode to LinLog mode needs a readjustment of the scaling parameter.

  • strong_gravity_mode[in] Sets a force that attracts the nodes that are distant from the center more. It is so strong that it can sometimes dominate other forces.

  • gravity[in] Attracts nodes to the center. Prevents islands from drifting away.

  • vertex_mobility_vertices[in] Vertex identities for vertex mobility.

  • vertex_mobility_values[in] Mobility of each vertex, used to scale the displacement at each iteration.

  • vertex_mass_vertices[in] Vertex identities for vertex mass.

  • vertex_mass_values[in] Mass of each vertex, which controls the attraction to other vertices. If not provided, the mass of each vertex will be its degree plus one.

  • verbose[in] Output convergence info at each interation.

  • do_expensive_check[in] A flag to run expensive checks for input arguments (if set to true)

  • result[out] Opaque object containing the layout result

  • error[out] Pointer to an error object storing details of any error. Will be populated if error code is not CUGRAPH_SUCCESS

Returns:

error code

cugraph_type_erased_device_array_view_t *cugraph_layout_result_get_vertices(
cugraph_layout_result_t *result
)#

Get layout vertices.

cugraph_type_erased_device_array_view_t *cugraph_layout_result_get_x_axis(
cugraph_layout_result_t *result
)#

Get layout x-axis.

cugraph_type_erased_device_array_view_t *cugraph_layout_result_get_y_axis(
cugraph_layout_result_t *result
)#

Get layout y-axis.

void cugraph_layout_result_free(cugraph_layout_result_t *result)#

Free a layout result.

Parameters:

result[in] The result from a layout algorithm

struct cugraph_layout_result_t#
#include <layout_algorithms.h>

Opaque layout output.

Public Members

int32_t align_#