# Path: route_model/misc.py
# def get_orig_path(dual_path):
# 	
# 	orig_path=[dual_path[1][0]]
# 	for i in range(1,len(dual_path)-1):
# 		orig_path.append(dual_path[i][1])
# 		
# 	return orig_path


from route_model.misc import get_orig_path
	
	result=[]
	config=choice_set_config
	
	the_network=G
	if G.orig_network is not None:
		the_network=G.orig_network
	
	for path_list in choice_sets:
		
		temp=[]
		
		hashes=[]; lengths=[]
		for cur_path in path_list:
			use_path=cur_path
			if G.orig_network is not None:
				use_path=get_orig_path(cur_path)
			cur_hash={}
			cur_length=0
			for i in range(len(use_path)-1):
				cur_hash[(use_path[i],use_path[i+1])]=the_network[use_path[i]][use_path[i+1]][config['overlap_var']]
				cur_length=cur_length+cur_hash[(use_path[i],use_path[i+1])]
			hashes.append(cur_hash)
			lengths.append(cur_length)
		min_length=min(lengths)

		for i in range(len(path_list)):
			PS=0
			for a in hashes[i]:
				delta_sum=0

# Path: route_model/misc.py
# def get_orig_path(dual_path):
# 	
# 	orig_path=[dual_path[1][0]]
# 	for i in range(1,len(dual_path)-1):
# 		orig_path.append(dual_path[i][1])
# 		
# 	return orig_path


# Path: route_model/choice_set/path_size.py
from route_model.misc import get_orig_path

	
	result=[]
	config=choice_set_config
	
	the_network=G
	if G.orig_network is not None:
		the_network=G.orig_network
	
	for path_list in choice_sets:
		
		temp=[]
		
		hashes=[]; lengths=[]
		for cur_path in path_list:
			use_path=cur_path
			if G.orig_network is not None:
				use_path=get_orig_path(cur_path)
			cur_hash={}
			cur_length=0
			for i in range(len(use_path)-1):
				cur_hash[(use_path[i],use_path[i+1])]=the_network[use_path[i]][use_path[i+1]][config['overlap_var']]
				cur_length=cur_length+cur_hash[(use_path[i],use_path[i+1])]
			hashes.append(cur_hash)
			lengths.append(cur_length)
		min_length=min(lengths)

		for i in range(len(path_list)):
			PS=0
			for a in hashes[i]:
				delta_sum=0

				for j in range(len(path_list)):