private Node findAHead(List<Node> unvisitedNodes, List<Link> unvisitedLinks) {
		if (unvisitedNodes.size() == 0) {
			return null;
		}
		Node candidate = unvisitedNodes.get(0);
		boolean changedCandidate = true;
		while (changedCandidate) {
			changedCandidate = false;
			for (Link link : unvisitedLinks) {
				if (link.to == candidate.id) {
					changedCandidate = true;
					candidate = findNodeById(link.from);
				}
			}
		}
		return candidate;
	}
Produce the DSL representation of the graph.
To make this process easier we can assume there is a START and an END node.

@return DSL string version of the graph
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/job/dsl/Graph.java