#ifndef __Bnodelist_h #define __Bnodelist_h #define EXIT_SUCCESS 0 #define EXIT_WRONGCOMMANDLINE 1 #define EXIT_MEMORY 2 #define EXIT_OPENFILE 3 // Status del problema: aperto, risolto, privo di soluzione #define OPEN_INSTANCE 0 #define YES_INSTANCE 1 #define NO_INSTANCE 2 typedef short boolean; #define TRUE 1 #define FALSE 0 // Branching information: // 1) number of subproblems // 2) branching variables typedef struct _branching branching; struct _branching { int numfigli; ??? }; // Local information for each branching node: // 1) Lower bound (ed eventualmente soluzione associata) // 2) vincoli di branching ereditati dal padre // 3) eventualmente, soluzione euristica e upper bound locali a questo nodo (se servono) // 4) statistiche varie sul nodo typedef struct _Bnodeinfo Bnodeinfo; struct _Bnodeinfo { ??? }; typedef struct _Bnode Bnode; struct _Bnode { // Debug information on the position of the branching node in the branching tree long id; // Numero d'ordine globale long livello; // Livello di profondita' nell'albero (0 per la radice) long id_figlio; // Numero d'ordine tra i fratelli del nodo stesso (da 1 a numfigli) // Local information produced by the processing of the node Bnodeinfo BNinfo; // Information on how to branch and generate subproblems branching branch; // Puntatori per gestire la lista dei problemi aperti Bnode* next; Bnode* prev; }; typedef Bnode* Bnodelist; typedef Bnode* Bnodepos; typedef Bnodelist Btree; Bnode* CreateBnode (long id, long livello, long id_figlio, ProblemData *pPD); Bnodelist CreateBnodelist (); void DestroyBnodelist (Bnodelist *pL); Bnodepos primolista (Bnodelist L); Bnodepos ultimolista (Bnodelist L); boolean finelista (Bnodepos p, Bnodelist L); boolean listavuota (Bnodelist L); Bnodepos succlista (Bnodepos p, Bnodelist L); Bnodepos preclista (Bnodepos p, Bnodelist L); void inslista (Bnode *Node, Bnodepos p, Bnodelist L); void canclista (Bnodepos *pp); Bnode *estraelista (Bnodepos *pp, Bnodelist L); void DestroyBnode (Bnode **pNode); #endif