********************************************************************
********************************************************************/
-/* $Id$ */
+/**
+ * @file
+ * @brief Solving the Minimum Assignment Problem using the Hungarian Method.
+ * @version $Id$
+ */
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
#include <stdio.h>
#include <stdlib.h>
int i;
hungarian_problem_t *p = xmalloc(sizeof(*p));
- memset(p, 0, sizeof(p));
+ memset(p, 0, sizeof(p[0]));
FIRM_DBG_REGISTER(p->dbg, "firm.hungarian");
void hungarian_add(hungarian_problem_t *p, int left, int right, int cost) {
assert(p->num_rows > left && "Invalid row selected.");
assert(p->num_cols > right && "Invalid column selected.");
+ assert(cost >= 0);
p->cost[left][right] = cost;
p->max_cost = MAX(p->max_cost, cost);