Skip to content

Commit

Permalink
address bug with vc alternatives occurring in chunk
Browse files Browse the repository at this point in the history
  • Loading branch information
Timeroot committed Jun 24, 2022
1 parent c9a0cdf commit c14aaad
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/ChunkCoverReductions.java
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,9 @@ public static ArrayList<Integer> solve(ArrayList<int[]> _edges, LinkedList<int[]
u = oB;
}
if(u != -1) {
if(inChunk[u])
continue;

//a funnel exists, oC - v - {oA, oB}
HashSet<Integer> Nv = new HashSet<Integer>(neighbors[v]);
HashSet<Integer> Nu = new HashSet<Integer>(neighbors[u]);
Expand Down Expand Up @@ -457,6 +460,8 @@ private static boolean checkKfunnel() {
if(totalDeg == expectedTotalDeg) {
//Great!
int nv = neighbors[v].get(lowDegNvi);
if(inChunk[nv])
continue vLoop;

if(LOG) System.out.println("k-funnel at "+v+" and "+nv);
resolveFunnel(v, nv);
Expand All @@ -478,6 +483,8 @@ private static boolean checkKfunnel() {
} else {
//great, there's exactly one edge missing, which means that it's a funnel with either one.
int nv = neighbors[v].get(lowishDegNvi);
if(inChunk[nv])
continue vLoop;

if(LOG) System.out.println("k-funnel at "+v+" and "+nv);
resolveFunnel(v, nv);
Expand Down
5 changes: 3 additions & 2 deletions src/Main_Load.java
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ public static void main_submit(String[] args) throws IOException {
2,674,631,276,450,1917,547,788,364,1137,510,452,273,575,715,2079,277,2179,2679,400,
2509,521,2837,2666,2043,2086,2628,1948,1955,214,554,2267,3709,513,2092,675,4420,4069,
5292,4906,4887,745,6254,6253,4928,755,10616,5198,9797,4752,21900,10159,58,8888,12710,
1741,915,24084,24091,21755,73,20628,22898
1741,915,24084,24091,21755,73,20628,22898,1469,20630,19518,1314
};
static int check_index = -1;

Expand All @@ -239,6 +239,7 @@ public static void main_test(String[] args) throws IOException {
long maxT = -1;
String prefix =
HEURISTIC ? "./heuristic_public/h_" : "./exact_public/e_" ;
// String prefix = "./exact_other/e_";

int done=0;
//#133 has a large chunk of {N=1650,E=5134}.
Expand All @@ -255,7 +256,7 @@ public static void main_test(String[] args) throws IOException {
PrintStream fileout = new PrintStream(new FileOutputStream(outName));

check_index = (i-1)/2;
if(check_index >= check_answers.length)
if(i%2 == 0 || check_index >= check_answers.length)
check_index = -1;

Main_Load ml;
Expand Down

0 comments on commit c14aaad

Please sign in to comment.