sample_graph.hsp

sample\basic\sample_graph.hsp » Plain Format

	#include "iron_graph.hsp"
	; 4-node graph: 0-1, 0-2, 1-3, 2-3
	dim adj, 16
	adj(0*4+1)=1 : adj(1*4+0)=1
	adj(0*4+2)=1 : adj(2*4+0)=1
	adj(1*4+3)=1 : adj(3*4+1)=1
	adj(2*4+3)=1 : adj(3*4+2)=1
	dim dist, 4
	graph_bfs adj, 0, 4, dist
	mes "BFS from 0: " + dist(0)+","+dist(1)+","+dist(2)+","+dist(3)