func calcTotalCost(cost_matrix, flow_matrix [][]float64, alpha float64, solution []int) float64 {
	var total_cost float64
	total_cost = 0.0
	for i, _ := range flow_matrix {
		for j, _ := range flow_matrix {
			collection_cost := flow_matrix[i][j] * cost_matrix[i][solution[i]]
			transportation_cost := flow_matrix[i][j] * cost_matrix[solution[i]][solution[j]] * alpha
			distribution_cost := flow_matrix[i][j] * cost_matrix[solution[j]][j]
			cost := collection_cost + transportation_cost + distribution_cost
			total_cost += cost
		}
	}
	return total_cost
}
//  calculate total_cost follow Spoke-Hub-Hub-spoke strategy
calculate total_cost follow Spoke-Hub-Hub-spoke strategy
// calculate total_cost follow Spoke - Hub - Hub - spoke strategy
func calcTotalCost(cost_matrix, flow_matrix [][]float64, alpha float64, solution []int) float64 {
	var total_cost float64
	total_cost = 0.0
	for i, _ := range flow_matrix {
		for j, _ := range flow_matrix {
			collection_cost := flow_matrix[i][j] * cost_matrix[i][solution[i]]
			transportation_cost := flow_matrix[i][j] * cost_matrix[solution[i]][solution[j]] * alpha
			distribution_cost := flow_matrix[i][j] * cost_matrix[solution[j]][j]
			cost := collection_cost + transportation_cost + distribution_cost
			total_cost += cost
		}
	}
	return total_cost
}
func calcTotalCost ( cost_matrix , flow_matrix [ ] [ ] float64 , alpha float64 , solution [ ] int ) float64 { var total_cost float64 total_cost = 0.0 for i , _ := range flow_matrix { for j , _ := range flow_matrix { collection_cost := flow_matrix [ i ] [ j ] * cost_matrix [ i ] [ solution [ i ] ] transportation_cost := flow_matrix [ i ] [ j ] * cost_matrix [ solution [ i ] ] [ solution [ j ] ] * alpha distribution_cost := flow_matrix [ i ] [ j ] * cost_matrix [ solution [ j ] ] [ j ] cost := collection_cost + transportation_cost + distribution_cost total_cost += cost } } return total_cost }
calculate total_cost follow Spoke-Hub-Hub-spoke strategy
calculate total_cost follow Spoke - Hub - Hub - spoke strategy