Skip to content

Commit

Permalink
Fix error when generate candidate list
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseMiguel92 committed Feb 22, 2020
1 parent d00a613 commit 11cf019
Show file tree
Hide file tree
Showing 45 changed files with 16,806 additions and 16,804 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ __pycache__
.idea
venv
.DS_STORE
.DS_Store
/setsBK/
/setsBK2/
/.vscode/
5 changes: 3 additions & 2 deletions grasp_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

# Messages
MAIN_TOTAL_TIME = "Total time: {0} seconds."
MAIN_LOG_PROCESS = "Processing: {0} - Solution type: {1} - Iteration: {2} - Alpha: {3} - Time: {4:1.5f}"
MAIN_LOG_PROCESS = "Processing: {0} - Solution type: {1} - Iteration: {2} - Alpha: {3} - Time: {4:1.5f} - Clique: {5}"
MAIN_SEP_NAMES = "_"

# Config
Expand Down Expand Up @@ -61,7 +61,8 @@ def split_name(total_path):
iteration) + MAIN_SEP_NAMES + str(alpha)
data.update({table_key_name: [graph.get_total_nodes(), density, ratio, cardinality,
find_grasp_sol_time, alpha]})
LOGGER.debug(MAIN_LOG_PROCESS.format(file, solution_type, iteration, alpha, find_grasp_sol_time))
LOGGER.debug(MAIN_LOG_PROCESS.format(file, solution_type, iteration, alpha, find_grasp_sol_time,
solution))
output_name = split_name(file)
export_filename = CSV_OUTPUT_FILE.format(solution_type, output_name)
GraphUtils.export_solution(CSV_OUTPUT_DIR, data, export_filename)
Expand Down
800 changes: 400 additions & 400 deletions output/solution_table_adjacent_set-a_random-1.csv

Large diffs are not rendered by default.

800 changes: 400 additions & 400 deletions output/solution_table_adjacent_set-a_random-5.csv

Large diffs are not rendered by default.

800 changes: 400 additions & 400 deletions output/solution_table_adjacent_set-b_random-10.csv

Large diffs are not rendered by default.

800 changes: 400 additions & 400 deletions output/solution_table_adjacent_set-b_random-9.csv

Large diffs are not rendered by default.

800 changes: 400 additions & 400 deletions output/solution_table_adjacent_set-c_market-3.csv

Large diffs are not rendered by default.

800 changes: 400 additions & 400 deletions output/solution_table_adjacent_set-d_wind-2005.csv

Large diffs are not rendered by default.

800 changes: 400 additions & 400 deletions output/solution_table_adjacent_set-d_wind-2006.csv

Large diffs are not rendered by default.

800 changes: 400 additions & 400 deletions output/solution_table_adjacent_set-e_c-fat500-1.csv

Large diffs are not rendered by default.

800 changes: 400 additions & 400 deletions output/solution_table_adjacent_set-e_email.csv

Large diffs are not rendered by default.

800 changes: 400 additions & 400 deletions output/solution_table_adjacent_set-e_football.csv

Large diffs are not rendered by default.

800 changes: 400 additions & 400 deletions output/solution_table_adjacent_set-e_johnson8-2-4.csv

Large diffs are not rendered by default.

800 changes: 400 additions & 400 deletions output/solution_table_adjacent_set-e_karate.csv

Large diffs are not rendered by default.

800 changes: 400 additions & 400 deletions output/solution_table_adjacent_set-e_p_hat1000-1.csv

Large diffs are not rendered by default.

800 changes: 400 additions & 400 deletions output/solution_table_adjacent_set-e_p_hat500-1.csv

Large diffs are not rendered by default.

800 changes: 400 additions & 400 deletions output/solution_table_adjacent_set-f_c-fat500-1.csv

Large diffs are not rendered by default.

800 changes: 400 additions & 400 deletions output/solution_table_adjacent_set-f_email.csv

Large diffs are not rendered by default.

800 changes: 400 additions & 400 deletions output/solution_table_adjacent_set-f_football.csv

Large diffs are not rendered by default.

800 changes: 400 additions & 400 deletions output/solution_table_adjacent_set-f_johnson8-2-4.csv

Large diffs are not rendered by default.

800 changes: 400 additions & 400 deletions output/solution_table_adjacent_set-f_karate.csv

Large diffs are not rendered by default.

800 changes: 400 additions & 400 deletions output/solution_table_adjacent_set-f_p_hat1000-1.csv

Large diffs are not rendered by default.

802 changes: 401 additions & 401 deletions output/solution_table_adjacent_set-f_p_hat500-1.csv

Large diffs are not rendered by default.

800 changes: 400 additions & 400 deletions output/solution_table_ratio_set-a_random-1.csv

Large diffs are not rendered by default.

800 changes: 400 additions & 400 deletions output/solution_table_ratio_set-a_random-5.csv

Large diffs are not rendered by default.

800 changes: 400 additions & 400 deletions output/solution_table_ratio_set-b_random-10.csv

Large diffs are not rendered by default.

800 changes: 400 additions & 400 deletions output/solution_table_ratio_set-b_random-9.csv

Large diffs are not rendered by default.

800 changes: 400 additions & 400 deletions output/solution_table_ratio_set-c_market-3.csv

Large diffs are not rendered by default.

800 changes: 400 additions & 400 deletions output/solution_table_ratio_set-d_wind-2005.csv

Large diffs are not rendered by default.

800 changes: 400 additions & 400 deletions output/solution_table_ratio_set-d_wind-2006.csv

Large diffs are not rendered by default.

800 changes: 400 additions & 400 deletions output/solution_table_ratio_set-e_c-fat500-1.csv

Large diffs are not rendered by default.

800 changes: 400 additions & 400 deletions output/solution_table_ratio_set-e_email.csv

Large diffs are not rendered by default.

800 changes: 400 additions & 400 deletions output/solution_table_ratio_set-e_football.csv

Large diffs are not rendered by default.

800 changes: 400 additions & 400 deletions output/solution_table_ratio_set-e_johnson8-2-4.csv

Large diffs are not rendered by default.

800 changes: 400 additions & 400 deletions output/solution_table_ratio_set-e_karate.csv

Large diffs are not rendered by default.

800 changes: 400 additions & 400 deletions output/solution_table_ratio_set-e_p_hat1000-1.csv

Large diffs are not rendered by default.

800 changes: 400 additions & 400 deletions output/solution_table_ratio_set-e_p_hat500-1.csv

Large diffs are not rendered by default.

800 changes: 400 additions & 400 deletions output/solution_table_ratio_set-f_c-fat500-1.csv

Large diffs are not rendered by default.

800 changes: 400 additions & 400 deletions output/solution_table_ratio_set-f_email.csv

Large diffs are not rendered by default.

800 changes: 400 additions & 400 deletions output/solution_table_ratio_set-f_football.csv

Large diffs are not rendered by default.

800 changes: 400 additions & 400 deletions output/solution_table_ratio_set-f_johnson8-2-4.csv

Large diffs are not rendered by default.

800 changes: 400 additions & 400 deletions output/solution_table_ratio_set-f_karate.csv

Large diffs are not rendered by default.

800 changes: 400 additions & 400 deletions output/solution_table_ratio_set-f_p_hat1000-1.csv

Large diffs are not rendered by default.

800 changes: 400 additions & 400 deletions output/solution_table_ratio_set-f_p_hat500-1.csv

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion solution_grasp.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def find_grasp_solution(self, graph, name, solution_type, fixed_seed, alpha):
total_keys = sorted(list(graph.nodes.keys()))
vertex = random.randint(total_keys[0], total_keys[-1])
solution = {vertex}
cl = graph.nodes[vertex].neighbors_indices
cl = graph.nodes[vertex].neighbors_indices.copy()
while len(cl) != 0:
g_min, g_max, gc = self.get_g(cl, solution_type, graph, name)
mu = g_max - alpha * (g_max - g_min)
Expand Down

0 comments on commit 11cf019

Please sign in to comment.