Kruskal Algorithm

Kruskal’s algorithm is an algorithm in graph theory that finds a minimum spanning tree for a connected weighted graph. This means it finds a subset of the edges that forms a tree that includes every vertex, where the total weight of all the edges in the tree is minimized. If the graph is not connected, then it finds a minimum spanning forest (a minimum spanning tree for each connected component). Kruskal’s algorithm is an example of a greedy algorithm.

LinkedList<PQEntry> kruskalEdges = new LinkedList<PQEntry>(); // List of entries after processing Algo
Iterator<PQEntry> it2=predefEdges.iterator();
while(it2.hasNext()){
PQEntry edge = it2.next();

String nodeA = edge.getNodeA();
String nodeB = edge.getNodeB();

// finding if theres any Entry with same Node
PQEntry entryA = findEntry(nodeA);
PQEntry entryB = findEntry(nodeB);

// Kruskal Algo Logic [START]
if(entryA == null){
kruskalEdges.add(edge);
}else{
if(entryB == null){
kruskalEdges.add(edge);
}else {
if(entryA != entryB){
if(edge.getWeight() < entryA.getWeight() && edge.getWeight() < entryB.getWeight()){
if(entryA.getWeight() < entryB.getWeight()){
kruskalEdges.remove(entryB);
}else{
kruskalEdges.remove(entryA);
}
kruskalEdges.add(edge);
}
if(edge.getWeight() < entryA.getWeight() && edge.getWeight() > entryB.getWeight()){
kruskalEdges.remove(entryA);
kruskalEdges.add(edge);
}
if(edge.getWeight() < entryB.getWeight() && edge.getWeight() > entryA.getWeight()){
kruskalEdges.remove(entryB);
kruskalEdges.add(edge);
}
}
}
}
// Kruskal Algo Logic [END]
}

private PQEntry findEntry(String node){
Iterator<PQEntry> it=kruskalEdges.iterator();
while(it.hasNext()){
PQEntry temp = it.next();
if(temp.getNodeA().equalsIgnoreCase(node)){
return temp;
}
if(temp.getNodeB().equalsIgnoreCase(node)){
return temp;
}
}
return null;
}

The Face Annotation Interface – faint

This project is a flexible Java framework for face detection and face recognition technologies, that is based on different plugin and filter types. A suitable graphical interface can be used to set up pipelines for detection and recognition by combining these plugins and filters. Moreover an integrated photo browser allows users to apply the face detection and recognition process on personal images.

Project Details

Modules included in the current release of faint:

  • OpenCV-Haarclassifier-Detection – JNI adapter to Intel’s OpenCV implementation of the Viola-Jones detection algorithm.
  • Betaface.com-Detection – Web Service adapter to detection functions of Betaface.com.
  • Skin-Color-Filter – Makes use of an 8Kb hue-saturation lookup table, based on training images provided by Michael Jones.
  • Eigenface-Recognition – A pure Java-based implementation of the Eigenfaces approach.
  • Simple-Context-Filter – Recognition filter avoiding duplicate occurrences of a person on a single photo.

The detected and recognized faces are stored in a local database, which can be modified manually from inside the application. In addition all face annotations can also be stored directly into the image files in Adobe XMP-Format on demand.

Initially developed in the context of a Bachelor Thesis at the University of Oldenburg, faint has been integrated into several projects maintained by the OFFIS Institute for Information Technology. To attract a broader audience, the source code has been released under GNU General Public License (GPL) in October 2007.

Download

Runnable JAR file:

Java Runtime Edition 6 or higher is required. In addition, the OpenCV-Detection-Plugin is currently only working on Windows systems.

Pwing

Pwing is a GUI toolkit, Is a set of widgets/components for use in designing applications with graphical user interfaces (GUI’s). It is based on Swing toolkit, part of Sun Microsystem’s Java Foundation Classes (JFC) API. It is developed to provide a better set of components to create more interactive GUI based applications in Java. Each component facilitates a specific user-computer interaction, and appears as a visible part of the computer’s GUI.

Click here to read more..

Windows Explorer (Dock)

Windows Explorer is a program that enables users to organize their shortcuts, programs and running tasks into an attractive and fun animated Explorer. By allowing users to have more control over how they organize their desktop, users can take control of their desktop icons and shortcuts to have them be available when where and how they need them. This, all with the unique style and top-rate performance.. click here to read more

Java Quiz

I`m really happy to say that i have won  Java quiz competition at NIIT.