Show / Hide Table of Contents

Class NearestNeighbours

An enumerable containing n-nearest neighbours and some extra information like maximum weight and n.

Inheritance
System.Object
NearestNeighbours
Namespace: System.Dynamic.ExpandoObject
Assembly: cs.temp.dll.dll
Syntax
public class NearestNeighbours : HashSet<int>

Constructors

NearestNeighbours(Int32)

Creates a new nearest neighbours enumerable.

Declaration
public NearestNeighbours(int n)
Parameters
System.Int32 n

Properties

Max

Gets the maximum weight of the furthest customer.

Declaration
public float Max { get; set; }
Property Value
System.Single

N

Gets the requested N.

Declaration
public int N { get; }
Property Value
System.Int32

Remarks

It's possible this contains less than N if problem size is smaller than N for example.

Methods

Backward(Single[][], Int32, Int32)

Calculates then n-nearest neighbours in a backward-direction only.

Declaration
public static NearestNeighbours Backward(float[][] weights, int n, int customer)
Parameters
System.Single[][] weights

System.Int32 n

System.Int32 customer

Returns
NearestNeighbours

BackwardDirected(Single[][], Int32, Int32)

Calculates then n-nearest neighbours in a backward-direction only.

Declaration
public static NearestNeighbours BackwardDirected(float[][] weights, int n, int customer)
Parameters
System.Single[][] weights

System.Int32 n

System.Int32 customer

Returns
NearestNeighbours

Forward(Single[][], Int32, Int32)

Calculates then n-nearest neighbours in a forward-direction only.

Declaration
public static NearestNeighbours Forward(float[][] weights, int n, int customer)
Parameters
System.Single[][] weights

System.Int32 n

System.Int32 customer

Returns
NearestNeighbours

ForwardDirected(Single[][], Int32, Int32)

Calculates then n-nearest neighbours in a forward-direction only.

Declaration
public static NearestNeighbours ForwardDirected(float[][] weights, int n, int customer)
Parameters
System.Single[][] weights

System.Int32 n

System.Int32 customer

Returns
NearestNeighbours

Back to top Built by Itinero, MIT licensed.