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
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}