
/*
**  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);

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

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

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

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

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

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

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


#endif
