PreviousUpNext

15.3.325  src/lib/graph/node-priority-queue.api

# node-priority-queue.api
# This implements a priority queue for nodes in a graph

# -- Allen Leung

# Compiled by:
#     src/lib/graph/graphs.lib

stipulate
    package odg =  oop_digraph;                                         # oop_digraph   is from   src/lib/graph/oop-digraph.pkg
herein

    api Node_Priority_Queue {
        #
        Node_Priority_Queue;

        exception EMPTY_PRIORITY_QUEUE;

        create:          Int -> ((odg::Node_Id, odg::Node_Id) -> Bool) ->  Node_Priority_Queue; 

        from_graph:       ((odg::Node_Id, odg::Node_Id) -> Bool)  ->   odg::Digraph(N,E,G) -> Node_Priority_Queue;

        is_empty:         Node_Priority_Queue -> Bool;
        clear:            Node_Priority_Queue -> Void;
        min:              Node_Priority_Queue -> odg::Node_Id; 
        delete_min:       Node_Priority_Queue -> odg::Node_Id;
        decrease_weight: (Node_Priority_Queue, odg::Node_Id) -> Void;
        set:             (Node_Priority_Queue, odg::Node_Id) -> Void;
    };
end;


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext