% clear all;
%   N=400;
% H=5;
%  charg_stations = randperm(N,0.2*N);
% %  charg_stations = randperm(N,1);
% initial_loc = randperm(N*H,0.4*N);
%  F = size(initial_loc,2);
% station_capacity= ones(1,floor(size(charg_stations,2))*F/(size(charg_stations,2)))+1 ;
% % station_capacity =[F]
% grid_dist=5;
% dist_h=20;
 theta= 4;
% Lambda = zeros(N*H,1);
% Lambda(N+1:end) = rand((H-1)*N,1)*1;
% mu = 1.5*sum(Lambda);
% [adj,dist_tij]=network1(H,N,charg_stations,grid_dist,dist_h);
[RebalanceDecision,RebalancePath,runtime,objective]=heuristic_mrk(Lambda,N,H,adj,dist_tij,theta,dist_h,station_capacity,charg_stations,sort(initial_loc,'ascend'),mu);
[RebalanceDecision2,RebalancePath2,runtime2,objective2]=MIP(Lambda, H, N, initial_loc, charg_stations, grid_dist,dist_h, station_capacity,theta,mu);

% Optimal matching under heuristic rebalance proposal 
% reb=sort(unique(RebalanceDecision))

Opt_gap=(objective-objective2)*100/objective2
faster=abs(runtime-runtime2)*100/runtime
