/* (C) Copyright 2003 Jens Lysgaard. All rights reserved. */
/* OSI Certified Open Source Software */
/* This software is licensed under the Common Public License Version 1.0 */

#ifndef _H_MXF
#define _H_MXF

typedef void *MaxFlowPtr;

void MXF_WriteArcList(MaxFlowPtr Ptr);
void MXF_WriteNodeList(MaxFlowPtr Ptr);
void MXF_InitMem(MaxFlowPtr *Ptr,
                 int TotalNodes,
                 int TotalArcs);
void MXF_FreeMem(MaxFlowPtr Ptr);
void MXF_ClearNodeList(MaxFlowPtr Ptr);
void MXF_ClearArcList(MaxFlowPtr Ptr);
void MXF_SetNodeListSize(MaxFlowPtr Ptr,
                         int TotalNodes);
void MXF_AddArc(MaxFlowPtr Ptr,
                int Tail,
                int Head,
                int Capacity);
void MXF_ChgArcCap(MaxFlowPtr Ptr,
                   int Tail,
                   int Head,
                   int Capacity);
void MXF_CreateMates(MaxFlowPtr Ptr);

void MXF_CreateArcMap(MaxFlowPtr Ptr);

void MXF_SolveMaxFlow(MaxFlowPtr Ptr,
                      char InitByZeroFlow,
                      int Source,
                      int Sink,
                      int *CutValue,
                      char GetSinkSide,
                      int *NodeListSize,
                      int *NodeList);

void MXF_GetNetworkSize(MaxFlowPtr Ptr,
                        int *Nodes,
                        int *Arcs);

void MXF_GetCurrentFlow(MaxFlowPtr Ptr,
                        int *ArcResidualCapacity,
                        int *NodeExcess);

void MXF_SetFlow(MaxFlowPtr Ptr,
                 int *ArcResidualCapacity,
                 int *NodeExcess);

void MXF_ComputeGHCutTree(MaxFlowPtr Ptr,
                          int CenterNode,
                          int *CutValue,
                          int *NextOnPath);

#endif
