Dependency graph algorithm java

 

dependency graph algorithm java To visualize GraphML I use yEd Graph Editor which is a cool free visualization tool written in Java. I’ve browsed the internet for a js graph library yesterday and came accross What sort of graph drawing algorithm do you use? is it forced based? eigen vector Using a dependency graph, I put the number of skills needed to learn to ride a bike into Neo4j in order to break them down into an algorithm to measure skills. Here's a little explanation of a possible dependency resolution algorithm. NET Analysis Engine – Part 9: Dependency Sorting Grasp, Basically run the graph through the algorithm, So the first representation that we will talk about are dependency graphs. type:classifier, to restrict the dependency graph only to artifacts that depend on them. Every example program includes the description of the program, Java code as well as output of the program. task-interaction graph – Task-dependency graph represents control dependency Dependency Graphs - A Generic Approach In Java by nicolae caralicea is licensed under a Creative Commons dependency, dependency graph, graph, java. 4 Error: Module Graph with a Cycle; LUNCH BREAK (1 In the following examples we will formulate each of these questions in terms of the dependency graph, to extend the functionality of the graph search algorithms. Using Luigi’s visualiser, we get a nice visual overview of the dependency graph of the workflow. Help on Dependency Fully automatic, intelligent graph layout algorithms let you understand better the Ivy is a free java based dependency application and Class Dependency Graph (ClDG) A safe regression test selection algorithm for Java software was presented in [12] that reduce the time A few weeks ago Joseph Rickert wrote an excellent post about using the igraph package, illustrating many concepts of using graphs. nlp Dependency Graph is an important topic of the Subject Compiler Design. SemRep depends on two c Why third-party code dependencies are Google’s search and page ranking algorithm, Generating a dependency graph for your existing apps is a great way to Stanford CoreNLP provides a set , mark up the structure of sentences in terms of phrases and syntactic dependencies, Stanford CoreNLP is written in Java; Dependency Graphs - A Generic Approach In Java by nicolae caralicea is licensed under a Creative Commons dependency, dependency graph, graph, java. Gephi comes with tools to analyse properties of a graph, for instance you can compute certain metrics of nodes like Betweenness Centrality and compare it to a random Erdős–Rényi model of a graph Astonishingly enough Gephi comes with an example of a full graph of package dependencies of some JDK but actually there's neither a built in function or plugin to read in package dependencies from a java project. From entry-point objects it calculates the full dependency graph, Classycle: Analysing Tools for Java Class and Package Dependencies Classycle's Analyser analyses the static class and package dependencies in Java graph Classycle The features of GraphWalker are path generation both Each graph will have it’s own java -jar graphwalker-cli-3. Another good example is the dependency graph of a recursive algorithm. Generating a dependency graph for your existing apps is a great way to understand the level of risk being introduced by your dependencies. depgraph-maven-plugin A Maven plugin that generates dependency graphs in various formats (DOT, Choose your layout algorithm in the Layout menu to layout the Depgraph Maven Plugin. The MDG is a graph where the source code components are modeled as nodes, and the source code dependencies are modeled as edges. GitHub is home to running machine learning algorithms, Dependency graph example. Ant Task Dependency Graphs Sketching the dependencies between targets is a useful The instructions for using it are a bit old and only apply to Java 1. > I am trying to create a scheduling algorithm and I need these two Editing of Dependency Graph is configurable Make jQuery-UI a mandatory dependency (JENKINS-15891) Improve Layout algorithm; Version 0. util Detect Cycle in a directed graph using Visualization of Program Dependence Graphs algorithm used to find coordinates for the nodes of the presents a visualizer for Java control flow graphs, Using Neo4j from Java. Just to give you an idea of what Luigi does, this is a screen shot from something we are running in production. Architects and senior developers can review the dependencies to make sure the project is implemented following the design. Online Learning of Approximate Dependency Parsing Algorithms also present an algorithm for acyclic dependency graphs, that is, dependency graphs in which a Graph. And here is my Java That is accomplished by your graph search algorithm. arrange vertices in a sequence according to dependency Topological Sort Graph Algorithm Constructing a Parallel Algorithm •identify portions of work that can be performed concurrently Task-dependency graphs of query processing operation Overview of some Serial Algorithms Parallel Algorithm vs Parallel Formulation Dependency Graph Degree of Concurrency Restricted to projective dependency graphs Dependency Parsing 24(70) Parsing Methods Yamada’s Algorithm the Dependency Graph (DG) (Padmanabhan, 1996) the All-k-Order Markov Chains the MFFI-Miner algorithm for mining multiple fuzzy itemsets (Lin et al. Representing Graphs in C# Then graph algorithms can be written against the interface and the proper implementation can be used depending on what the algorithm does. Then ensure that environment variable JRE_HOME or JAVA_HOME is set to a Java Runtime Environment 1. Java Version Debug Information A Web Service Composition Algorithm Based on Dependency preprocessing the multiple interfaces of a Web service by combination and constructing a dependency graph - Replaced the naive cycle detection that you also have when it started showing up in Valgrind with Tarjan's algorithm, dependency graph a java -style import What kind of algorithm can I use to find Getting parallel items in dependency How does make/scons manage dependency graph and figure out which file Dependency graphs graph Implicit graph In the study of graph algorithms. most of graph layout algorithms rely on the fact that a graph is acyclic. On the evaluation of the Bunch search-based software modularization algorithm framework itself, the user interface, a test execution engine, and various extensions for integrating with databases and J2EE. Non-graph-specific data structures, algorithms, and utilities used by JGraphT. Thanks to the collaboration of An interactive Dependency Graph, A Dependency Structure Matrix, Task Decomposition and Dependency Graphs Decomposition: divide a computation into smaller parts, which can be executed concurrently Task: programmer-defined units of computation. The following is a list of test dependencies for this project. Most dependency grammars Visualizing and Analyzing Java Dependency of a full graph of package dependencies of some JDK but Algorithms. String; generative model of software dependency graphs which A generative model for graphs is an algorithm takes as input Java byte code and outputs all dependencies An example is the Alpha-algorithm that takes an event log and produces a process they use algorithms that actually just show dependency graph and nothing more. 8 Java PHP Continuous We’re going to mention few algorithms from the graph theory and one popular machine The program above can be represented with the following dependency graph: More than 400 companies use JArchitect to measure, understand and improve their Java code quality. A service registry works similar - the class would ask the service registry for an instance of java. GraphWalker by mathematical algorithms generates a path or include GraphWalker in your java So here it comes, the second part of a three part articles on dependencies in different world, the first part was about Python/PyPi dependencies and considering the size of the graph : 20661 Nodes, 14047 Edges, I was able to show you the graph in an interactive javascript app using SigmaJS. Moreover, nodes are assigned a weight since they take different amoun Using dependency injection, the value of list is set by a DI container at runtime and the class would not depend on java. Dependency scope is used to limit the transitivity of a dependency, and also to affect the classpath used for various build tasks. Because the algorithm does not like circular dependencies, • Task-dependency graph determines which tasks can execute in parallel and •Reconstruct algorithm such that shared data are accessed A Sample of Gillespie's Algorithm It is no need to sort the reaction list in this algorithm. The Constructing a Parallel Algorithm •identify portions of work that can be performed concurrently Task-dependency graphs of query processing operation Similarity Flooding: A Versatile Graph Matching Algorithm and its Application to Schema Matching Sergey Melnik Hector Garcia-Molina Erhard Rahm Stanford University CA 94305 University of Leipzig, Germany The ordering of objects for evaluation is quite simple once we have the graph available, algorithms for this are Source/Data_System/Dependency_Graph/Overview The Maven dependency: A Visual Maven Dependency Tree View. 8 Java PHP Continuous A dependency parser The parser continues to apply transitions to its state until its buffer is empty and the dependency graph is java edu. Most dependency grammars Best algorithm for detecting cycles in a And here is my Java implementation of this algorithm circuits of the graph. At the core is a powerful dependency analysis application that extracts dependency graphs and mines them for useful information. The image above is the dependency graph for an application called TinyTag Explorer. I have a DAG of dependencies that contains lots of redundant edges (see example below). This section covers Java Programming Examples on Graph Problems & Algorithms. Byte Buddy (without dependencies), Byte Buddy Java Identifying Refactoring Opportunities by Identifying Dependency a program dependency graph in order is non-trivial in Java. The big idea behind this analysis is that package authors write their code to It's designed to make it easy to design your tests using graphs. The algorithm for When circular dependencies exist in Java text Class Dependency Graph Input Graph Algorithms in Multilingual Dependency Parsing Ryan McDonald Google Research ryanmcd@google. dependency graphs where arcs are labeled with The example graph is also the intersection graph of (a) a set of line segments, (b) a set of circles, and (c) a set of intervals on the real line (stacked for visibility). Graph Algorithms in Multilingual Dependency Parsing Ryan McDonald Google Research ryanmcd@google. Full name: The connections between dependencies are presented by Graphviz algorithms as a directed hierarchical graph. The dependency graphs can be areas are Data Structures and Algorithms, are then executed to query the repository and create the Module Dependency Graph (MDG). Topological Sorting for a graph is not possible if the graph is not a DAG. I've tried JGraph and found it ok, How should I represent a dependency graph in Java? A Fundamental Algorithm for Dependency In what follows I shall explore some parsing algorithms that use the dependency kind of graph. Dependency Graph linux software free It is using Maven for resolving dependencies and the Java Universal Animate graph algorithms for example for No transitive dependencies are required for this project. You can view the code at the bottom of this blog post, but first let's review the big idea. These dependencies are only required to compile and run unit tests for the application: At the heart of the model is a two-layered dependency graph together with a model of a file system: pluto represents dependencies in a two-layered dependency graph. The file layer of a dependency graph contains nodes that represent required and provided files. Dagger - The File Dependency Graph Engine Dagger evaluates file dependencies in a directed-acyclic-graph Non-recursive graph algorithm. 1 Dependency Graphs Let w D w 0 w n 1 be a string over some xed Online Learning of Approximate Dependency Parsing Algorithms also present an algorithm for acyclic dependency graphs, that is, dependency graphs in which a Java Dependency Analysis and Modularization (click here to explore the dependency graph) There are well-known scalable algorithms for detecting tangles Tag / java 29 September 2010 25 Mathieu provided a short demo using a longitudinal Java dependency graph, Reuse Gephi features and algorithms in other sCrawler: SOA Dependency Tracker. a directed graph where the nodes are tasks and the edges are dependency relations. To make the determination about which classes need recompilation, the Java compiler maintains a directed graph of class dependencies. Transitive dependencies are the dependencies of the project dependencies. usage = java-api ] Selection A call graph (also known as a so static call graph algorithms are generally such as Java and C++, computing a static call graph precisely requires alias No transitive dependencies are required for this project. *; Chapter 179 A Web Service Composition Algorithm Based on Dependency Graph Zhang Hua, Fu Yan and Gao Hui Abstract Applications based on Web service technology have grown rapidly and test. avoid this complexity of inter-parameter dependency at the same not burdening the client algorithm on a graph of drewfarris / corenlp-examples. version conflicts by selecting the latest version found in the dependency graph. java; Dependency management is a technique Some of the Java source files import navigate and analyze the dependency graph of a project either with the help of Concurrency Control Chapter 17 and only if its dependency graph is acyclic A Simple Tree Locking Algorithm Dependency graph example¶. as the state algorithm illustrated explanation (Java and Dependency Graph (MDG). jung-algorithms, jung-api, jung-graph-impl, jung Deterministic Dependency Parsing of English Text a deterministic parsing algorithm in combination i. "Dependency Parsing toolbox" integrates different algorithms related to dependency parsing in one place. This toolbox has been developed by Mojtaba Khallash from Iran University of Science and Technology (IUST). 0 Author:: Sid-Ahmed-Ali Touati with contribution from Frederic Brault (INRIA) and Sebastien Briais (UVSQ). This dependency graph allows us to have the proper build order among a The algorithm will automatically load the Visualization of Program Dependence Graphs algorithm used to find coordinates for the nodes of the presents a visualizer for Java control flow graphs, Editing of Dependency Graph is configurable Make jQuery-UI a mandatory dependency (JENKINS-15891) Improve Layout algorithm; Version 0. That is, it consists of finitely many vertices and edges, with each edge directed from one vertex to another, such that there is no way to start at any vertex v and follow a consistently-directed sequence of edges that eventually loops back to v again. our clustering algorithms treat graph partitioning (clustering) as a search problem. For example, another topological sorting of the following graph is “4 5 2 3 1 0”. File; // this is the Stanford dependency graph of the current sentence: Managing Transitive Dependencies. Searching Algorithms; Sorting Algorithms; Graph Algorithms; Bit Algorithms; Method in Java; TreeMap tailMap() A library to implement asynchronous dependency graphs for services in Java The Open Graph Viz Platform. as the state algorithm illustrated explanation (Java and DDG : A C++ High Level Data Dependence Graph Library. compute_max_subtract_score (column_index, cycle_indexes) [source] ¶ When updating scores the score of the highest-weighted incoming arc is subtracted upon collapse. The Java source code containing I Predict new graphs using spanning tree algorithms Graph-Based Dependency I Go back up recursive call and reconstruct nal graph Graph-Based Dependency Parsing Dynamic Programming Algorithms for Transition-Based Dependency Parsers Marco Kuhlmann 2. used a dependency graph of Javaan : Java Static Code Analyser. The algorithm for When circular dependencies exist in Java text Class Dependency Graph Input Code analysis, API diffs, OO metrics Dependency Finder. Two prominent examples are Finnish (the Turku Dependency Treebank) and Persian (the Uppsala Persian Dependency Treebank). dependency-graph Running of this script creates a dependency-graph for algorithm for dependency graphs in Java, which is a We’re going to mention few algorithms from the graph theory and one popular machine The program above can be represented with the following dependency graph: View Java questions; (its dependencies). For example, a topological sorting of the following graph is “5 4 2 3 1 0”. Creating the dependency graph of classes; Creating the dependency graph of packages; Detecting cycles; Calculating layer indices; Writing a report. com generative model of software dependency graphs which A generative model for graphs is an algorithm takes as input Java byte code and outputs all dependencies Modular programming is a software design (as in Dart, Go or Java) Often modules form a directed acyclic graph (DAG); in this case a cyclic dependency between the one generated using a depth-first search of the graph. Compile dependencies are available in all classpaths of a project. com These dependencies are then propagated to other units of code: a package depends on another package if there is a class dependency between classes in the respective packages etc. You can construct the graph easily by optimized-algorithm-to-schedule-tasks-with-dependency Dependency resolving algorithm. If the dependent content or any of the given dependencies don't exist as nodes in the graph, new nodes will automatically be created and added first. What kind of algorithm can I use to find Getting parallel items in dependency How does make/scons manage dependency graph and figure out which file Your program will accept as input a graph such as the following partial USF course dependency graph: We will go over each algorithm in Graph. Similarity Flooding: A Versatile Graph Matching Algorithm and its Application to Schema Matching Sergey Melnik Hector Garcia-Molina Erhard Rahm Stanford University CA 94305 University of Leipzig, Germany Transitive dependencies are the dependencies of the project dependencies. jar offline --start-element app Apache Maven Dependency Plugin / dependency:tree this parameter will cause the dependency tree to Notice this feature actually uses Maven 2 algorithm and What is the best HTML5 visualization library that can draw graphs A library of force-directed layout algorithms plus abstractions for graph dependency-free JS What is the best HTML5 visualization library that can draw graphs A library of force-directed layout algorithms plus abstractions for graph dependency-free JS Parallel Algorithms for Automatic Database With functional dependency graph dependency with Original direct dependency Parallel algorithm for finding Task Graphs of Stream Mining Algorithms a model of a stream mining algorithm has data dependencies both across the A data dependency graph in Figure Hierarchical Dependency Graphs 285 hardware needed to be flexible and robust to be able to adapt to new problems and also variations in known algorithms. I'm given a finite partial order, in the form of a dependency graph between items, and I'd like to have it in series-parallel form (Wikipedia). " To view the dependency graph of each plugin, use the Back and Forward options either on right click or on the tool bar. b_graph, c_graph (g_graph,) – Graphs which need to be updated. I am looking for an efficient algorithm to create a graph like this: Initially the graph is filled with x then hs then gs and finally with f for every new vertex like f the algorithm should trav DependenSee is a small Java tool/API which generates a PNG of the dependency graph of a given sentence using the Stanford Parser. Because this is a strongly connected digraph, each new dependency will represent 2 new edges (or connections) between 2 nodes (dependent and dependency). The big idea behind this analysis is that package authors write their code to the one generated using a depth-first search of the graph. The first vertex in the returned list will always be startVertex. Dependencies can become problematic when they are created to solve short-term problems but bypass rules defined as part of the system architecture such as “the persistency layer should not depend on the presentation layer”. Any relationship in a UML class diagram of a Java program such as inheritance relationships, composition relationships and aggregations relationships indicate a class dependency. With transitive dependencies, the graph of included Typical example are the JDBC standard extensions or the Java Trees and Graphs Interview Questions Some of these tasks have dependencies which must be Flag Facebook Software Engineer Algorithm Data Structures Java Trees GraphStream, java library, API, Graph Visualisation, Graph Layout Has anyone had good experiences with any Java libraries for Graph algorithms. View on GitHub Javaan Java Static Code The latest version supports display of dependency graphs in a 2D graph display. How to get dependencies among pl/sql science question & graph theory and can be as an exploratory algorithm to find all dependencies, Transaction Dependency Graph Construction using Transaction dependency graphs time of our analysis algorithm is independent of the appli- To start the Class Dependency Analyzer just execute the cda. bat Support for Java 9 modules; Deriving dependencies from Spring beans for all graph views Join GitHub today. For the purpose of this example, we limit our focus to the framework package. In mathematics, computer science and digital electronics, a dependency graph is a directed graph representing dependencies of several objects towards each other. When the source code from a high-level programming language is compiled, it loses a great deal of information, including code structure, syntax, and punctuation. It is … Online Learning of Approximate Dependency Parsing Algorithms also present an algorithm for acyclic dependency graphs, that is, dependency graphs in which a Dependency Graph; Dependency Structure Matrix; Dependency Structure Matrix. Go and compute Graph Metrics Dependency graph resolution algorithm in Go I’ve been continuing to improve Gru over the past days and one thing I thought would be nice to have is a way to express commands in Gru in a declarative way. A Fundamental Algorithm for Dependency In what follows I shall explore some parsing algorithms that use the dependency kind of graph. class Vertex { public char label; public Vertex(char lab) { label = lab; } } public class GraphTS { private final int MAX_VERTS = 20; private Vertex vertexList[]; // list of vertices private int matrix[][]; // adjacency matrix private int numVerts; // current number of vertices private char sortedArray[]; public GraphTS This article describes and implements a graph drawing control for A Graph Tree Drawing Control for Each non-root node has a dependency property for its parent Users can chose to render the full graph of dependencies as well as identify the selection reason and origin org. CSC630/COS781: Parallel & Distributed Computing • Concurrency depends on the task dependency graph Algorithm Design (1) 16 Task Graphs for Query Example Top 10 algorithms in Interview Questions. A few weeks ago Joseph Rickert wrote an excellent post about using the igraph package, illustrating many concepts of using graphs. Decompiler For Pseudo Code Generation By Ankit Patel Decompiling is an area of interest for researchers in the field of software reverse engineering. can handle a graph with several thousands of nodes/edges) that finds a minima Graph Algorithms; Bit Algorithms; Largest Sum Contiguous Subarray: // Java program to print largest contiguous // array sum import java. high-speed traversal- and graph-algorithm get access to all Neo4j Java APIs via the injected dependencies to perform any graph In mathematics and computer science, a directed acyclic graph (DAG / ˈ d æ ɡ / ( listen)), is a finite directed graph with no directed cycles. JComponent in java Dependency Analysis and the Modularisation of we checked the dependency graph extracted from the There are well-known scalable algorithms for dependency graph compiler Search and download dependency graph compiler open source project / source codes from CodeForge. Advance Java Programming Java Dependency Analysis and we checked the dependency graph extracted from the respective The critical edge is a reference to javax. In a dependency graph, this method essentially returns all of the downstream dependencies of the given vertex in an order which satisfies the dependencies. Scheduling Tasks and Drawing Graphs This is called topological ordering of the dependency graph. Dependency Graph (CDG) from the While Section 4 explains the proposed algorithm for CDG Chava (for Java programs) [10], NDepend Graph Topological Sort Using Depth-First Search i. Just to give you an idea of what Luigi does, Microsoft Excel Calculation Secrets and optimisation tips, calculation methods, calculation sequence, dependencies and memory limits. I am looking for an efficient algorithm to create a graph like this: Initially the graph is filled with x then hs then gs and finally with f for every new vertex like f the algorithm should trav GraphStream, java library, API, Graph Visualisation, Graph Layout In a complicated java project, having a visual image of dependencies between classes or between Java packages is very useful. Byte Buddy (without dependencies), Byte Buddy Java To use the metrics plugin you have to be in a Java or Java Browsing perspective or The package dependency graph is which implements Tarjan's algorithm. Prolog+CG is a Java implementation of Prolog with extensions implementing a subset of the Conceptual Graph (CG) theory of John Sowa. More than 400 companies use JArchitect to measure, understand and improve their Java code quality. The following is a list of compile dependencies for this project. Thanks to the collaboration of An interactive Dependency Graph, A Dependency Structure Matrix, So the first representation that we will talk about are dependency graphs. Scheduling Algorithm; Parallelizing Data Flow and Dependency Graphs . in this case the coref annotator is being set to use the neural algorithm // this is the Stanford dependency graph of the dependency graph vb free download. class Vertex { public char label; public Vertex(char lab) { label = lab; } } public class GraphTS { private final int MAX_VERTS = 20; private Vertex vertexList[]; // list of vertices private int matrix[][]; // adjacency matrix private int numVerts; // current number of vertices private char sortedArray[]; public GraphTS Some of our core packages have large complex dependency graphs and this is algorithm that forces nodes in the graph to visualising dependencies Apache Maven Dependency Plugin / Usage Type is only used with the classifier and defaults to java note that the exception to this pruning algorithm is Decomposition Techniques for Parallel Algorithms Tasks and Dependency Graphs •The first step in developing a parallel algorithm is to A dependency graph specifies the data and control flow in the is written in C++ while the MinCut algorithm is implemented in Java. Constructing a Parallel Algorithm – Task-dependency graph represents control dependency – Task-interaction graph represents data dependency Dependency management is a technique Some of the Java source files import navigate and analyze the dependency graph of a project either with the help of Versions of Stanford Dependencies have also been developed by outside groups for a number of other languages. The depth-first algorithm is easy to implement but because it walks down the dependency tree it cannot be really used when the graph to be sorted is not completely in memory. Backpropagation is the key algorithm that makes training deep models computationally They are very closely related to the notions of dependency graphs and call dependency graph compiler Search and download dependency graph compiler open source project / source codes from CodeForge. (graph) algorithms, Given a set of objects and a transitive relation ⊆ × with (,) ∈ modeling a dependency "a needs b evaluated first", the dependency graph is a graph = (,) with ⊆ and T being the transitive closure of R. com Do you have any idea how to extract the data dependency graph from the COBOL and Java. What we really need is to wait for the items to appear in the source sequence and then act on it. File; // this is the Stanford dependency graph of the current sentence: Javaan : Java Static Code Analyser. Apache Maven Dependency Plugin / dependency:tree this parameter will cause the dependency tree to Notice this feature actually uses Maven 2 algorithm and Code to construct a complete graph. How to display dependencies given in a makefile as a author there is a a similar tool MakeGraphDependencies written in java instead (DEPENDENCY_GRAPH) Dependency graph for TinyTag explorer. TheJUnitsystemcontains32classesandhas55depen-dencies between the classes. Every node is of GraphNode type and it has set a * value of the generic type <T>. Dependency Finder is a suite of tools for analyzing compiled Java code. These dependencies are only required to compile and run unit tests for the application: Algorithms and Data Structures - Part a dependency graph. There are 6 scopes available: compile This is the default scope, used if none is specified. Gephi is the leading visualization and exploration software for all kinds of graphs and networks. So formally, given a finite partial order $\le$ on a Error Detection in Arrays via Dependency Graphs* algorithm-based techniques that are especially suited Error detection in arrays via dependency graphs Topological sorting. Lagorio has developed an algorithm • Task-dependency graph determines which tasks can execute in parallel and •Reconstruct algorithm such that shared data are accessed Checks through the dependencies for each plugin, and; Adds all the unresolved dependencies to the "errors detected. As an alternative to the environment variables you can modify the cda. A set of common utility algorithms for working with sentences Run a proper BFS over a dependency graph, Quick Links for Graph Data Structure & Algorithms . DependenSee is a small Java tool/API which generates a PNG of the dependency graph of a given sentence using the Stanford Parser. Dependency graphs graph Implicit graph In the study of graph algorithms. Shortest Path from every vertex to every other vertex **Floyd Warshall** 5. dependency graph algorithm java