Hamilton

by MateiEpure on February 29th, 2012
No notes
Syntax: C++
Show lines - Hide lines - Show in textbox - Download
for (int conf = 0; conf < (1<<k) - 1; ++i)
	for (int i = 1; i <= k; ++i)
		if (a[i][conf])
			for (int j = i; j <= k; ++j)
				if (bitter(j)^conf && a[j][conf + bitter(j)] > a[i][conf] + d[i][j])
					a[j][conf + bitter(j)] = a[i][conf] + d[i][j];

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS