// Numbas version: exam_results_page_options {"name": "Julien's copy of Hungarian algorithm", "extensions": ["optimisation"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Julien's copy of Hungarian algorithm", "metadata": {"description": "", "licence": "Creative Commons Attribution 4.0 International"}, "tags": [], "rulesets": {}, "functions": {"calculate_cost": {"type": "string", "definition": "var o = [];\nfor(var i=0;i{num_workers} {workers} have to decide who will attend each of {num_jobs} {jobs} on a particular day. The distances, in miles, that each {worker} would have to travel to each {job} are given below.

\n

{job_cost_table(costs,capitalise(worker),capitalise(job))}

", "ungrouped_variables": [], "advice": "

#### a)

\n

Use the Hungarian algorithm to find the assignment giving the minimum total distance.

\n

{hungarian_display(costs)}

\n

#### b)

\n

The total distance is \$\\var{calculate_cost(costs,solution)} = \\var{total_cost}\$ miles.

", "parts": [{"minMarks": 0, "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "answers": ["{capitalise(job)} 1", "{capitalise(job)} 2", "{capitalise(job)} 3", "{capitalise(job)} 4", "{capitalise(job)} 5"], "marks": 0, "minAnswers": 0, "prompt": "

Find an assignment of {workers} to {jobs} which minimises the total distance travelled.