fPQ.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /**
  2. * @file
  3. * @brief @ref snode priority queue for @ref shortPath in @ref sgraph
  4. */
  5. /*************************************************************************
  6. * Copyright (c) 2011 AT&T Intellectual Property
  7. * All rights reserved. This program and the accompanying materials
  8. * are made available under the terms of the Eclipse Public License v1.0
  9. * which accompanies this distribution, and is available at
  10. * https://www.eclipse.org/legal/epl-v10.html
  11. *
  12. * Contributors: Details at https://graphviz.org
  13. *************************************************************************/
  14. #pragma once
  15. #include <ortho/sgraph.h>
  16. #include <util/alloc.h>
  17. #define N_VAL(n) (n)->n_val
  18. #define N_IDX(n) (n)->n_idx
  19. #define N_DAD(n) (n)->n_dad
  20. #define N_EDGE(n) (n)->n_edge
  21. #define E_WT(e) (e->weight)
  22. void PQgen(int sz);
  23. void PQfree(void);
  24. void PQinit(void);
  25. void PQcheck (void);
  26. void PQupheap(int);
  27. int PQ_insert(snode* np);
  28. void PQdownheap (int k);
  29. snode* PQremove (void);
  30. void PQupdate (snode* n, int d);
  31. void PQprint (void);