class KeanuComputableGraph implements ComputableGraph {

    @Override
    public Map<VariableReference, ?> compute(Map<VariableReference, ?> inputs) {

        for (Map.Entry<VariableReference, ?> input : inputs.entrySet()) {
            vertexLookup.get(input.getKey()).setValue(input.getValue());
        }

        for (int i = 0; i < topoSortedGraph.size(); i++) {

            final Vertex vertex = topoSortedGraph.get(i);

            if (!vertex.isProbabilistic() && !vertex.isObserved()) {
                vertex.setValue(((NonProbabilistic) vertex).calculate());
            }
        }

        return outputs.stream()
            .collect(toMap(Vertex::getReference, v -> (Object) v.getValue()));
    }

    public  KeanuComputableGraph(List<Vertex> topoSortedGraph, Set<Vertex> outputs);

}