function path = LEM_dpath(E,v1,v2)
%

path = 0;
nodes(1).parent = 0;
nodes(1).v = v1;
nodes(1).children = [];
num_nodes = 1;
OPEN = [1,v1]
CLOSED = [];

while ~isempty(OPEN)
    index = OPEN(1,1);
    v = OPEN(1,2);
    OPEN = OPEN(2:end,:);
    CLOSED = [CLOSED; v];
    if v==v2
        path = 1;
        return
    end
    indexes = find(E(:,1)==v);
    c_id = E(indexes,2);
    num_c_id = length(c_id);
    for k = 1:num_c_id
        vk = c_id(k);
        if isempty(find(OPEN(:,2)==vk))&isempty(find(CLOSED==vk))
            num_nodes = num_nodes + 1;
            nodes(num_nodes).parent = v;
            nodes(num_nodes).v = vk;
            nodes(num_nodes).children = [];
            nodes(index).children = [nodes(index).children,vk];
            OPEN = [OPEN; num_nodes, vk];
        end
    end
end
tch = 0;
