Similar Louvain query giving different results


(Aforadi) #1

Hello,

I am calling Louvain algorithms using 2 different syntactical ways but the same meaning (alteast I think so :) ). I am getting different results and I don't understand if this is a bug.

#1
CALL algo.louvain(
"MATCH (p:Network_L1_Louvain) RETURN id(p) as id",
"MATCH (p:Network_L1_Louvain)-[f:INTERACTED]-(m:Network_L1_Louvain) RETURN id(p) as source, id(m) as target",
{graph:'cypher',write:true, writeProperty:'partition_test', concurrency:1});

#2
CALL algo.louvain('Network_L1_Louvain','INTERACTED',{concurrency:1, write:true,writeProperty:'partition_test2'});

#2 results
+---------------------------------------------------------------------------------+
| loadMillis | computeMillis | writeMillis | nodes | iterations | communityCount |
+---------------------------------------------------------------------------------+
| 5770 | 4501 | 4048 | 900558 | 5 | 100340 |
+---------------------------------------------------------------------------------+

#1 results
| loadMillis | computeMillis | writeMillis | nodes | iterations | communityCount |
+---------------------------------------------------------------------------------+
| 36892 | 1924257 | 2607 | 900558 | 5 | 83023 |
+---------------------------------------------------------------------------------+

The run times are also very different. Is this a known bug?

Thanks
Aditya


(Aforadi) #2

2 more issues.

a) It doesn't seem to make a difference if I use a weight property in #1

CALL algo.louvain(
"MATCH (p:Network_L1_Louvain) RETURN id(p) as id",
"MATCH (p:Network_L1_Louvain)-[f:INTERACTED]-(m:Network_L1_Louvain) RETURN id(p) as source, id(m) as target, f.amt as weight",
{graph:'cypher',write:true, writeProperty:'partition_L1', concurrency:1, weightProperty:'weight'});
+---------------------------------------------------------------------------------+
| loadMillis | computeMillis | writeMillis | nodes | iterations | communityCount |
+---------------------------------------------------------------------------------+
| 90029 | 1893360 | 3918 | 900558 | 5 | 83023 |
+---------------------------------------------------------------------------------+

b) The non-projected query with weight property throws an error.

CALL algo.louvain('Network_L1_Louvain','INTERACTED',{ weightProperty:'amt',defaultValue:0.0, concurrency:1, write:true, writeProperty:'partition_test2'});
Failed to invoke procedure algo.louvain : Caused by: java.lang.ArrayIndexOutOfBoundsException: -1

Would appreciate any insights into this. Thanks!