Show / Hide Table of Contents

Class SoftHeap<TKey, TValue>

Soft heap, which aims to has a constant amortized time for creation of heap, inserting an element merging two heaps, deleting an element and finding the element with minimum key.

Inheritance
System.Object
SoftHeap<TKey, TValue>
Implements
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey, TValue>>
System.Collections.IEnumerable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: QuikGraph.Collections
Assembly: QuikGraph.dll
Syntax
[Serializable]
public sealed class SoftHeap<TKey, TValue> : IEnumerable<KeyValuePair<TKey, TValue>>, IEnumerable
Type Parameters
Name Description
TKey

Key type.

TValue

Value type.

Constructors

| Improve this Doc View Source

SoftHeap(Double, TKey)

Initializes a new instance of the SoftHeap<TKey, TValue> class.

Declaration
public SoftHeap(double maximumErrorRate, TKey keyMaxValue)
Parameters
Type Name Description
System.Double maximumErrorRate

Indicates the maximum error rate to respect.

TKey keyMaxValue

Gives the maximum key value.

Exceptions
Type Condition
System.ArgumentNullException

keyMaxValue is null.

System.ArgumentOutOfRangeException

maximumErrorRate is not in range ]0, 0.5].

| Improve this Doc View Source

SoftHeap(Double, TKey, Comparison<TKey>)

Initializes a new instance of the SoftHeap<TKey, TValue> class.

Declaration
public SoftHeap(double maximumErrorRate, TKey keyMaxValue, Comparison<TKey> comparison)
Parameters
Type Name Description
System.Double maximumErrorRate

Indicates the maximum error rate to respect.

TKey keyMaxValue

Gives the maximum key value.

System.Comparison<TKey> comparison

Key comparer.

Exceptions
Type Condition
System.ArgumentNullException

keyMaxValue is null.

System.ArgumentNullException

comparison is null.

System.ArgumentOutOfRangeException

maximumErrorRate is not in range ]0, 0.5].

Properties

| Improve this Doc View Source

Count

Number of element.

Declaration
public int Count { get; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

ErrorRate

Error rate.

Declaration
public double ErrorRate { get; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

KeyComparison

Key comparer.

Declaration
public Comparison<TKey> KeyComparison { get; }
Property Value
Type Description
System.Comparison<TKey>
| Improve this Doc View Source

KeyMaxValue

Maximal authorized key.

Declaration
public TKey KeyMaxValue { get; }
Property Value
Type Description
TKey
| Improve this Doc View Source

MinRank

Minimal rank (based on ErrorRate).

Declaration
public int MinRank { get; }
Property Value
Type Description
System.Int32

Methods

| Improve this Doc View Source

Add(TKey, TValue)

Adds the given value with the given key into the heap.

Declaration
public void Add(TKey key, TValue value)
Parameters
Type Name Description
TKey key

Key.

TValue value

Value to add.

Exceptions
Type Condition
System.ArgumentNullException

key is null.

System.ArgumentException

key is superior to KeyMaxValue.

| Improve this Doc View Source

GetEnumerator()

Declaration
public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator()
Returns
Type Description
System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<TKey, TValue>>
| Improve this Doc View Source

RemoveMinimum()

Gets and removes the minimal pair.

Declaration
public KeyValuePair<TKey, TValue> RemoveMinimum()
Returns
Type Description
System.Collections.Generic.KeyValuePair<TKey, TValue>

The minimal pair.

Exceptions
Type Condition
System.InvalidOperationException

The heap is empty.

Explicit Interface Implementations

| Improve this Doc View Source

IEnumerable.GetEnumerator()

Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type Description
System.Collections.IEnumerator

Implements

System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable

Extension Methods

GraphMLExtensions.SerializeToGraphML<TVertex, TEdge, TGraph>(TGraph, String)
GraphMLExtensions.SerializeToGraphML<TVertex, TEdge, TGraph>(TGraph, String, VertexIdentity<TVertex>, EdgeIdentity<TVertex, TEdge>)
GraphMLExtensions.SerializeToGraphML<TVertex, TEdge, TGraph>(TGraph, XmlWriter)
GraphMLExtensions.SerializeToGraphML<TVertex, TEdge, TGraph>(TGraph, XmlWriter, VertexIdentity<TVertex>, EdgeIdentity<TVertex, TEdge>)
GraphMLExtensions.DeserializeFromGraphML<TVertex, TEdge, TGraph>(TGraph, XmlReader, IdentifiableVertexFactory<TVertex>, IdentifiableEdgeFactory<TVertex, TEdge>)
GraphMLExtensions.DeserializeFromGraphML<TVertex, TEdge, TGraph>(TGraph, TextReader, IdentifiableVertexFactory<TVertex>, IdentifiableEdgeFactory<TVertex, TEdge>)
GraphMLExtensions.DeserializeFromGraphML<TVertex, TEdge, TGraph>(TGraph, String, IdentifiableVertexFactory<TVertex>, IdentifiableEdgeFactory<TVertex, TEdge>)
GraphMLExtensions.DeserializeAndValidateFromGraphML<TVertex, TEdge, TGraph>(TGraph, TextReader, IdentifiableVertexFactory<TVertex>, IdentifiableEdgeFactory<TVertex, TEdge>)
SerializationExtensions.SerializeToXml<TVertex, TEdge, TGraph>(TGraph, XmlWriter, VertexIdentity<TVertex>, EdgeIdentity<TVertex, TEdge>, String, String, String, String)
SerializationExtensions.SerializeToXml<TVertex, TEdge, TGraph>(TGraph, XmlWriter, VertexIdentity<TVertex>, EdgeIdentity<TVertex, TEdge>, String, String, String, String, Action<XmlWriter, TGraph>, Action<XmlWriter, TVertex>, Action<XmlWriter, TEdge>)
EdgeExtensions.IsPath<TVertex, TEdge>(IEnumerable<TEdge>)
EdgeExtensions.HasCycles<TVertex, TEdge>(IEnumerable<TEdge>)
EdgeExtensions.IsPathWithoutCycles<TVertex, TEdge>(IEnumerable<TEdge>)
GraphExtensions.ToDelegateVertexAndEdgeListGraph<TVertex, TEdge>(IEnumerable<TVertex>, TryFunc<TVertex, IEnumerable<TEdge>>)
GraphExtensions.ToDelegateVertexAndEdgeListGraph<TVertex, TEdge>(IEnumerable<TVertex>, Func<TVertex, IEnumerable<TEdge>>)
GraphExtensions.ToDelegateUndirectedGraph<TVertex, TEdge>(IEnumerable<TVertex>, TryFunc<TVertex, IEnumerable<TEdge>>)
GraphExtensions.ToDelegateUndirectedGraph<TVertex, TEdge>(IEnumerable<TVertex>, Func<TVertex, IEnumerable<TEdge>>)
GraphExtensions.ToAdjacencyGraph<TVertex, TEdge>(IEnumerable<TEdge>, Boolean)
GraphExtensions.ToAdjacencyGraph<TVertex, TEdge>(IEnumerable<TVertex>, Func<TVertex, IEnumerable<TEdge>>, Boolean)
GraphExtensions.ToBidirectionalGraph<TVertex, TEdge>(IEnumerable<TEdge>, Boolean)
GraphExtensions.ToBidirectionalGraph<TVertex, TEdge>(IEnumerable<TVertex>, Func<TVertex, IEnumerable<TEdge>>, Boolean)
GraphExtensions.ToUndirectedGraph<TVertex, TEdge>(IEnumerable<TEdge>, Boolean)
AlgorithmExtensions.IsDirectedAcyclicGraph<TVertex, TEdge>(IEnumerable<TEdge>)
AlgorithmExtensions.IsUndirectedAcyclicGraph<TVertex, TEdge>(IEnumerable<TEdge>)
  • Improve this Doc
  • View Source
In This Article
Back to top QuikGraph