00001 #ifndef _DJS_DEGENERACY_HELPER_H_ 00002 #define _DJS_DEGENERACY_HELPER_H_ 00003 00004 /* 00005 This program is free software: you can redistribute it and/or modify 00006 it under the terms of the GNU General Public License as published by 00007 the Free Software Foundation, either version 3 of the License, or 00008 (at your option) any later version. 00009 00010 This program is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 GNU General Public License for more details. 00014 00015 You should have received a copy of the GNU General Public License 00016 along with this program. If not, see <http://www.gnu.org/licenses/> 00017 */ 00018 00019 #include<assert.h> 00020 #include<stdio.h> 00021 #include<stdlib.h> 00022 00023 #include"misc.h" 00024 #include"LinkedList.h" 00025 #include"MemoryManager.h" 00026 00051 struct NeighborList 00052 { 00053 int vertex; 00054 LinkedList* earlier; 00055 LinkedList* later; 00056 int orderNumber; 00057 }; 00058 00059 typedef struct NeighborList NeighborList; 00060 00069 struct NeighborListArray 00070 { 00071 int vertex; 00072 int* earlier; 00073 int earlierDegree; 00074 int* later; 00075 int laterDegree; 00076 int orderNumber; 00077 }; 00078 00079 typedef struct NeighborListArray NeighborListArray; 00080 00081 int computeDegeneracy(LinkedList** list, int size); 00082 00083 NeighborList** computeDegeneracyOrderList(LinkedList** list, int size); 00084 00085 NeighborListArray** computeDegeneracyOrderArray(LinkedList** list, int size); 00086 00087 int neighborListComparator(void* nl1, void* nl2); 00088 00089 #endif