yangdx commited on
Commit
f9258cc
·
1 Parent(s): 08138b4

Prevent duplicate edges in Lightrag graph

Browse files
lightrag_webui/src/hooks/useLightragGraph.tsx CHANGED
@@ -578,6 +578,9 @@ const useLightrangeGraph = () => {
578
  if (sigmaGraph.hasEdge(newEdge.source, newEdge.target)) {
579
  continue;
580
  }
 
 
 
581
 
582
  // Add the edge to the sigma graph
583
  newEdge.dynamicId = sigmaGraph.addDirectedEdge(newEdge.source, newEdge.target, {
 
578
  if (sigmaGraph.hasEdge(newEdge.source, newEdge.target)) {
579
  continue;
580
  }
581
+ if (sigmaGraph.hasEdge(newEdge.target, newEdge.source)) {
582
+ continue;
583
+ }
584
 
585
  // Add the edge to the sigma graph
586
  newEdge.dynamicId = sigmaGraph.addDirectedEdge(newEdge.source, newEdge.target, {