mirror of
https://github.com/HKUDS/LightRAG.git
synced 2026-01-06 03:40:46 +00:00
Prevent duplicate edges in Lightrag graph
- Check for reverse edge existence
This commit is contained in:
parent
5e1c9f93ca
commit
07b13ee739
@ -578,6 +578,9 @@ const useLightrangeGraph = () => {
|
||||
if (sigmaGraph.hasEdge(newEdge.source, newEdge.target)) {
|
||||
continue;
|
||||
}
|
||||
if (sigmaGraph.hasEdge(newEdge.target, newEdge.source)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Add the edge to the sigma graph
|
||||
newEdge.dynamicId = sigmaGraph.addDirectedEdge(newEdge.source, newEdge.target, {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user