orientdb icon indicating copy to clipboard operation
orientdb copied to clipboard

Several edge types in shortestpath()

Open dargolith opened this issue 10 years ago • 2 comments

Hi,

It would be nice to specify more than one allowed edge type for shortestpath. It would mean: "Give me the shortest path only using one of these edge classes".

Is there a reason for it not being supported?

I only briefly glanced at the code, but it seems to me like the inner algorithm itself already supports it.

String   edgeType;
String[] edgeTypeParam;

...

ctx.edgeType = null;
if (iParams.length > 3) {
    ctx.edgeType = iParams[3] == null ? null : "" + iParams[3];
}
ctx.edgeTypeParam = new String[] { ctx.edgeType };

Seems like ctx.edgeTypeParam is the one being used later in the code and it is an array already. Would it work by just allowing an array argument for the function?

dargolith avatar Feb 11 '16 04:02 dargolith

https://github.com/orientechnologies/orientdb/issues/7842 requested the same change. Fix is in https://github.com/orientechnologies/orientdb/commit/3b660af55ee8f6fa34336a47fde71c9e93504175 and will be released in 2.2.30.

katherinessmith avatar Nov 20 '17 21:11 katherinessmith

Thank you very much @katherinessmith

I think we can close this

Thanks

Luigi

luigidellaquila avatar Nov 21 '17 07:11 luigidellaquila