commit 045d85da7aafd30360ed0f1dce919b128eacd4dd
parent ba3615db7a8d458ce1d5b25a408bc58b02361c15
Author: Marc Jeanmougin <marc@jeanmougin.fr>
Date: Sat, 5 Apr 2014 16:47:07 +0200
a
Diffstat:
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a/contest/mc/mc2.cpp b/contest/mc/mc2.cpp
@@ -9,7 +9,7 @@ int choose(vector<int> sss,vector<bool> eee,int pt){
int somme=0;
for(int aaaa=0;aaaa<adj[pt].size();aaaa++){
if(eee[id_arete[make_pair(pt,adj[pt][aaaa])]])p[aaaa]=1;
- else p[aaaa]=10000/(sss[adj[pt][aaaa]])*(sss[adj[pt][aaaa]]);
+ else p[aaaa]=1000*adj[adj[pt][aaaa]].size()*sss[adj[pt][aaaa]];
//else if(sss[adj[pt][aaaa]])p[aaaa]=200;
// else p[aaaa]=10000;
somme+=p[aaaa];
@@ -66,7 +66,7 @@ printf("%d\n",n_vehicules);
int bsol=0;
vector<int> best_sol[8];
-for(int test=0;test<100;test++){
+for(int test=0;test<50;test++){
vector<int> sss(12000,1);
vector<bool> eee(18000,false);
@@ -75,7 +75,12 @@ for(int i=0;i<n_vehicules;i++){
sortie[i].clear();
int pt=s_depart;
sortie[i].push_back(s_depart);
- completion_hasard(0,i,sss,eee);
+ sortie[i].push_back(8255);
+
+ sortie[i]=complete(sortie[i]);
+ int ttt=evalue_solution(sortie[i])[sortie[i].size()];
+
+ completion_hasard(ttt,i,sss,eee);
}
int aaa=score_solution(sortie);
if( aaa > bsol){ for(int i=0;i<n_vehicules;i++)best_sol[i]=sortie[i]; bsol=aaa;fprintf(stderr,"%d\n",aaa);}
@@ -88,13 +93,6 @@ if( aaa > bsol){ for(int i=0;i<n_vehicules;i++)best_sol[i]=sortie[i]; bsol=aaa;f
vector<int> sortiesuivante[8];
vector<int> bs2[8];
-fprintf(stderr,"pruning\n");
-prune(best_sol,sortiesuivante);
-fprintf(stderr,"pruned\n");
-
-for(int i=0;i<n_vehicules;i++)bs2[i]=complete(sortiesuivante[i]);
-
-fprintf(stderr,"completed %d\n",score_solution(bs2));
//affichage de la solution