
/*
**  This file forms part of the GOBLIN C++ Class Library.
**
**  Written by Christian Fremuth-Paeger, December 1998.
**  
**  Copying, compiling, distribution and modification
**  of this source code is permitted only in accordance
**  with the GOBLIN general licence information.
*/             


#if !defined(_ABSBIG_H_)

#define _ABSBIG_H_

#include <absgra.h>


class abstractBiGraph : public virtual abstractGraph
{
protected:

    TNode           n1;         // Number of outer nodes
    TNode           n2;         // Number of inner nodes
    
public:

    abstractBiGraph(TNode nn1 = 0,TNode nn2 = 0) throw(ERRange);
    virtual ~abstractBiGraph() throw();

    unsigned long   Allocated() throw();
    void            CheckLimits() throw(ERRange);

    bool            IsBipartite() throw() {return 1;};
    
    TNode           N1() throw()  {return n1;};
    TNode           N2() throw()  {return n2;};
    
    bool            Outer(TNode v) throw(ERRange);
    bool            Inner(TNode v) throw(ERRange);
    
    void            RandomArcs(TArc mm) throw(ERRejected);

    void            WriteBiGraph(char* fileName,TWriteInc options) throw(ERFile);
    virtual void    Write(char* fileName) throw(ERFile)
                        {WriteBiGraph(fileName,WRITE_INCIDENCES);};

    bool            MaximumAssignment() throw();
    bool            MaximumAssignment(TCap cDeg) throw();
    bool            MaximumAssignment(TCap *pLower,TCap *pDeg = NULL) throw();

    bool            MinCAssignment() throw();
    bool            MinCAssignment(TCap cDeg) throw();
    bool            MinCAssignment(TCap *pLower,TCap *pDeg = NULL) throw();
    bool            PMHeuristicsCandidates() throw();

    bool            MaximumMatching() throw()
                        {return MaximumAssignment();};
    bool            MaximumMatching(TCap cDeg) throw()
                        {return MaximumAssignment(cDeg);};
    bool            MaximumMatching(TCap *pLower,TCap *pDeg = NULL) throw()
                        {return MaximumAssignment(pLower,pDeg);};

    bool            MinCMatching() throw()
                        {return MinCAssignment();};
    bool            MinCMatching(TCap cDeg) throw()
                        {return MinCAssignment(cDeg);};
    bool            MinCMatching(TCap *pLower,TCap *pDeg = NULL) throw()
                        {return MinCAssignment(pLower,pDeg);};

    TNode           StableSet() throw();
    TNode           VertexCover() throw();
    TNode           NodeColouring(TNode = NoNode) throw();
    
};                           


#endif
