i can create a graph using cytoscape js
library . i am following the this tutorial and i implement like this.
CODE:
$(function(){ /
Assuming you have picked two nodes and stored them in source_node
and target_node
, and you want to label everything in between with class 'path_element':
p = cy.elements().aStar({root: source_node, goal: target_node, directed: true}).path;
if (p) {
p.filter(function(i,x) { return x != source_node && x != target_node; })
.addClass('path_element');
p.edgesWith(p)
.addClass('path_element');
}