Recommend this page to a friend! |
![]() ![]() |
Info | ![]() |
![]() |
![]() ![]() |
Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2022-01-13 (3 months ago) ![]() | ![]() ![]() ![]() | Total: 1,277 | All time: 2,996 This week: 204![]() |
Version | License | Categories | ||||
graphcoloring 1.0.2 | GNU General Publi... | Algorithms, PHP 5, Math |
Description | Author | |||
This class can be used to assign colors to graph points defined in a vertex list. Innovation Award
|
What's graph coloring: In a connected graph (where vertices are connected e.g. no isolated vertex exists), graph coloring is the process that ensures proper marker (/color) has (/have) been assigned to a vertex so that no adjacent (connected) vertices hold the same marker (/color). How this class works: This class implemented a new algorithm of graph coloring. The present class works as follow: 1. Gets graph from source (file OR DB) 1. Represents the graph (connections as well) as an array 2. Traverses the array to color vertices according to the algorithm 3. Displays the color result The New Graph Coloring Algorithm: The new approach of graph coloring works as follow: ========================================================================== graph = graph array i=1 j=1 while(i<=no_of_vertices) while(j<=no_of_vertices) if (graph[i][j]==1) i. color vertex i, push it into the colored array ii. process(i) else graph[i][j]:= 0; endif 6. j++ End of while 7. i++ End of while ----------------------------------------- function process(j) i=1 while(i<=no_of_vertices) if(graph[j][i]==1) (i). graph[j][i]:=0 //Disconnects the colered vertex j from its connected ones -- duplex disconnection (ii).Disconnects vertex i(which is connected to the newly colored vertex j)from its connected ones--simplex disconnection endif End of while end of function ==================================================================================== I am not giving the complexity analysis of this algorithm here. Future versions will come with so. And Me: I have designed and implemented this new graph coloring algorithm in C++ first. Then, as a Web Programmer, I decided to implement it in PHP. This class is the result of such thinking. I hope that everyone (especially those like programming) will enjoy it and implement it to their applications. Please rate this class if you like and if it comes to your needs. Please feel free to contact me for any further assistance regarding the algorithm and implementation. ============================================================================== MA Razzaque Rupom (aka Rupom Razzaque) Moderator, phpResource Group http://groups.yahoo.com/group/phpresource/ CEO, OS CLiCKS http://www.osclicks.com My Blog : http://rupom.wordpress.com Emails: rupom@osclicks.com rupom.bd@gmail.com |
Screenshots | ||
![]() |
File | Role | Description |
---|---|---|
![]() ![]() |
Data | Input SQL |
![]() ![]() |
Data | Input File |
![]() |
Class | The Main Class File |
![]() ![]() |
Doc. | Documentation File |
![]() ![]() |
Example | Example Usage |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
0% |
|
|
User Ratings | ||||||||||||||||||||||||||||||
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.
Pages that reference this package |
Being The Innovation Award Winner of May, 2006 Finally my class Graph Coloring won the “Innovation Award” at PHP Classes... |