rgg v0.1.0 RGG.Square.Bucketization

This module contains logic specific to the bucket algorithm for connecting the nodes in the graph. The bucket based connection algorithm allows us to connect nodes in linear time.

Link to this section Summary

Functions

This function selects the proper bucket numbers for a node based on it’s x location, y location, and the number of buckets

iex>RGG.Square.Bucketization.get_bucket_from_node(%RGG.Node{x: 0, y: 0}, 10)
{0, 0}
iex>RGG.Square.Bucketization.get_bucket_from_node(%RGG.Node{x: 1, y: 0.5}, 10)
{10, 5}

This function maps nodes into their appropriate buckets before connection

This function returns the nodes that must be tested in order to connect a node in the graph

This function selects the proper bucket numbers for a node based on it’s x location, y location, and the number of buckets

iex>RGG.Square.Bucketization.get_bucket_from_node(%RGG.Node{x: 0, y: 0}, 10)
{0, 0}
iex>RGG.Square.Bucketization.get_bucket_from_node(%RGG.Node{x: 1, y: 0.5}, 10)
{10, 5}

Link to this section Functions

Link to this function curry_put_node_in_bucket(n)

This function selects the proper bucket numbers for a node based on it’s x location, y location, and the number of buckets

iex>RGG.Square.Bucketization.get_bucket_from_node(%RGG.Node{x: 0, y: 0}, 10)
{0, 0}
iex>RGG.Square.Bucketization.get_bucket_from_node(%RGG.Node{x: 1, y: 0.5}, 10)
{10, 5}
Link to this function find_buckets(nodes, number_of_buckets)

This function maps nodes into their appropriate buckets before connection.

Link to this function get_adjacent_nodes_for_bucket(node, buckets)

This function returns the nodes that must be tested in order to connect a node in the graph.

Link to this function get_bucket_from_node(node, number_buckets)

This function selects the proper bucket numbers for a node based on it’s x location, y location, and the number of buckets

iex>RGG.Square.Bucketization.get_bucket_from_node(%RGG.Node{x: 0, y: 0}, 10)
{0, 0}
iex>RGG.Square.Bucketization.get_bucket_from_node(%RGG.Node{x: 1, y: 0.5}, 10)
{10, 5}