|
Search this API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecty.util.pq.BHeapDoubleNodePQ
public class BHeapDoubleNodePQ
This class implements a priority queue for nodes whose priority values are of type double.
The implementation is based on binary heaps.

| Constructor Summary | |
|---|---|
BHeapDoubleNodePQ(Graph graph)
Creates an empty NodePQ for nodes contained in the given graph. |
|
| Method Summary | |
|---|---|
void |
add(Node v,
double value)
Adds the given node with with given priority to this queue. |
void |
changePriority(Node v,
double p)
Changes the priority value of the given node. |
void |
clear()
Makes this queue the empty queue. |
boolean |
contains(Node v)
Returns whether or not the given node is contained in this queue. |
void |
decreasePriority(Node v,
double priority)
Decreases the priority value of the given node. |
void |
dispose()
Does nothing. |
Node |
getMin()
Returns the node with smallest priority in this queue. |
double |
getMinPriority()
Returns the minimum priority value in this queue. |
double |
getPriority(Node v)
Returns the current priority of the given node. |
void |
increasePriority(Node v,
double priority)
Increases the priority value of the given node. |
boolean |
isEmpty()
Returns whether or not this queue is empty |
void |
remove(Node v)
Removes the given node from this queue. |
Node |
removeMin()
Removes the node with smallest priority from this queue. |
int |
size()
Returns the number of nodes currently in this queue |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BHeapDoubleNodePQ(Graph graph)
| Method Detail |
|---|
public void add(Node v,
double value)
add in interface DoubleNodePQ
public void decreasePriority(Node v,
double priority)
decreasePriority in interface DoubleNodePQv - a node in the priority queue.priority - the new priority of the node.
public void increasePriority(Node v,
double priority)
public void changePriority(Node v,
double p)
public Node removeMin()
removeMin in interface DoubleNodePQpublic Node getMin()
getMin in interface DoubleNodePQpublic double getMinPriority()
public boolean contains(Node v)
contains in interface DoubleNodePQpublic boolean isEmpty()
isEmpty in interface DoubleNodePQpublic int size()
public double getPriority(Node v)
getPriority in interface DoubleNodePQpublic void remove(Node v)
public void clear()
clear in interface DoubleNodePQpublic void dispose()
dispose in interface DoubleNodePQ
|
© Copyright 2000-2025, yWorks GmbH. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||