GSoC/2020/StatusReports/DilsonGuimaraes: Difference between revisions

From KDE Community Wiki
< GSoC‎ | 2020‎ | StatusReports
Line 12: Line 12:
I created a tool to apply layout algorithms to graphs in Rocs, named graph-layout plugin. It allows the user to select an algorithm and apply it to a graph. Algorithm specific parameters can also be selected. In total, three algorithms were implemented: Force-Based Layout, Radial Tree Layout and Layered DAG Layout.
I created a tool to apply layout algorithms to graphs in Rocs, named graph-layout plugin. It allows the user to select an algorithm and apply it to a graph. Algorithm specific parameters can also be selected. In total, three algorithms were implemented: Force-Based Layout, Radial Tree Layout and Layered DAG Layout.


The graph-layout plugin user interface can be found in Graph Document -> Tools -> Graph Layout. There is a separate tab for each one of the layout algorithms available. In each one of these tabs the parameters of the corresponding layout algorithm can be selected.
The graph-layout plugin user interface can be found at Graph Document -> Tools -> Graph Layout. There is a separate tab for each one of the layout algorithms available. In each one of these tabs the parameters of the corresponding layout algorithm can be selected.




==== Force-Based Layout ===
==== Force-Based Layout ====
   
   
The Force-Based Layout algorithm was implemented in the first phase of the project. It is the simplest and the most general algorithm from the ones considered in this project. It can applied to any graph, but no guarantees are given about the resulting layout. In practice, it can generate reasonable results for some graphs.
The Force-Based Layout algorithm was implemented in the first phase of the project. It is the simplest and the most general algorithm from the ones considered in this project. It can applied to any graph, but no guarantees are given about the resulting layout. In practice, it can generate reasonable results for some graphs.


[[File:Force-based-layout-ui-screenshot.png|thumb|center|Graph-layout plugin user interface.]]
A screenshot of the corresponding tab in the graph-layout plugin user interface follows, as well as some example layouts generated by the Force-Based Layout.
 
[[File:Force-based-layout-ui-screenshot.png|thumb|left|Graph-layout plugin user interface.]]
[[File:2020-06-17-planar.png|thumb|right]]
 


==== Implemented layout algorithms ====
==== Implemented layout algorithms ====

Revision as of 21:51, 24 August 2020

Project Overview

Project name: Better Graph Layout for the Graph Theory IDE

The goal of this project is to enable Rocs (https://kde.org/applications/education/rocs) to layout graphs automatically. The project consists of three parts. The first one deals with a layout algorithm that can be applied to any graph. The second part and the third part deal with layout algorithms for trees and directed acyclic graphs, respectively.

The original proposal can be found here.

Work Report

Added features

I created a tool to apply layout algorithms to graphs in Rocs, named graph-layout plugin. It allows the user to select an algorithm and apply it to a graph. Algorithm specific parameters can also be selected. In total, three algorithms were implemented: Force-Based Layout, Radial Tree Layout and Layered DAG Layout.

The graph-layout plugin user interface can be found at Graph Document -> Tools -> Graph Layout. There is a separate tab for each one of the layout algorithms available. In each one of these tabs the parameters of the corresponding layout algorithm can be selected.


Force-Based Layout

The Force-Based Layout algorithm was implemented in the first phase of the project. It is the simplest and the most general algorithm from the ones considered in this project. It can applied to any graph, but no guarantees are given about the resulting layout. In practice, it can generate reasonable results for some graphs.

A screenshot of the corresponding tab in the graph-layout plugin user interface follows, as well as some example layouts generated by the Force-Based Layout.

Graph-layout plugin user interface.


Implemented layout algorithms

The layout algorithms in this section are already implemented, tested and documented.

  • Force based layout: A graph layout algorithm based on the simulation of forces acting on nodes.
  • Radial tree layout: A graph layout algorithm specifically designed for trees.

Layout algorithms to be implemented in the future

The layout algorithms in this section will be implemented during the remaining time of the project.

  • A layout algorithm for Directed Acyclic Graphs.

Merge requests

All my commits can the found in the following merge requests.

Graph-layout plugin, with force-based layout and radial tree layout.

Layered directed acyclic graph layout algorithm included in the graph-layout plugin (Work in progress).

Blog

My blog can be found here.. The links to posts related to this project are given below:

Experience

I really enjoyed working on this project. Most of my experience writing software is related to research, competitive programming or course projects. This project was a great opportunity for me to work in something different and get more experience working in a code base I did not create, with tools I did not choose. I learned a lot about Qt, which is used a lot in Rocs.

The open source world is something new for me. I already knew and used a lot of open source software, but I never contributed before deciding to apply to GSoC. The efforts of open source communities such as KDE are able to produce great results and it feels nice to become part of something so amazing.

I had to learn about graph layout algorithms to implement this project. I always have fun when I learn new algorithms. This time was not different. Two of the three layout algorithms I implemented are completely heuristic. The only way to get an intuition about the results that they can achieve is by experimentation. Although I love when there is a mathematical proof that the result of an algorithm is good, there are many important situations in which the best thing that can be done is to write a heuristic solution and test it a lot. This is why I value the experience I had working on them.