This is an implementation of TraClus (TRAjectory CLUStering) [1] algorithm in Java. A GUI was added for the convenience.
The original paper of this algorithm can be found at http://hanj.cs.illinois.edu/pdf/sigmod07_jglee.pdf The authors of the paper implemented the algorithm in C++, so it could be helpful to develop one in Java for other users to use. I have compared the output with the one generated by the C++ implementation, so far I have not found any bugs. It will be great if any one reports any bugs about this implementation.
I am currently involved in a maritime traffic project which requires me to implement various clustering algorithms. So that is the very first motivation about why I do this implementation. I also implemented another clustering algorithm called DBSCANSD which was proposed during my thesis study and you can find its code from the follwoing link: https://github.com/luborliu/DBSCANSD
After downloading it to local,
-
cd to the folder of src/boliu/
-
compile all the .java files using:
javac *.java
-
cd to the folder of src/
-
execute the program using the following either command:
-
java boliu.Main inputfile outputfile
--e.g. java boliu.Main deer_1995.tra testOut.txt
In this way, the program will help you to decide the parameters for eps and minLns;
-
java boliu.Main inputfile outputfile eps minLns
--e.g. java boliu.Main deer_1995.tra testOut.txt 29 8
In this way, you tell the program the parameters for eps and minLns, which are 29 and 8 separately.
-
-
waiting for the result :)
-
Star it if it helps *-*
The data format is as follows:
1st line: Number of dimensions (2 for example)
2nd line: Number of trajectories (32 for example)
3rd line: Trajectory Index (starting from 0, so 0 for this line), Number of trajectory points in this trajectory (n for example), X1, Y1, X2, Y2, …., Xn, Yn
4th line: Trajectory Index (starting from 0, so 1 for this line), Number of trajectory points in this trajectory (m for example), X1, Y1, X2, Y2, …., Xm, Ym
.
.
.
34th line:Trajectory Index (starting from 0, so 31 for this line), Number of trajectory points in this trajectory (j for example), X1, Y1, X2, Y2, …., Xj, Yj
[1] Lee, Jae-Gil, Jiawei Han, and Kyu-Young Whang. "Trajectory clustering: a partition-and-group framework." Proceedings of the 2007 ACM SIGMOD international conference on Management of data. ACM, 2007.
02/23/2017 Create License file under MIT license as requested.
03/10/2016 Fix a bug (reported by @luca-zamboni) that will throw InputMismatchException while the code is downloaded in some countries.
02/02/2016 Fix a bug (reported by Dieter) of estimation function (cannot give right output according to different input files).
11/25/2015 Fix a bug (reported by @ankushdas) that makes the program not work for multi-dimensional (>2) data set.