Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraphSpace - Diff for Graphs #417

Open
wants to merge 108 commits into
base: master
Choose a base branch
from

Conversation

jahandaniyal
Copy link
Collaborator

@jahandaniyal jahandaniyal commented Jul 31, 2019

Purpose

The Diff interface in GraphSpace allows a user to Compare TWO graphs to find interesting features which are common to both graphs or features unique to one graph but not the other. This feature currently supports 2 operations - Graph Intersection and Graph Difference. The same access rules regarding My graph, Public and Shared graphs also apply to Compare Graph feature. Users can only compare graphs they access to - graphs owned privately by other users cannot be accessed unless it is shared to them or made public.

Feature Details

There are 2 ways users can access this feature -

Compare Graph Tab

Graph diff can be accessed from Graphs index page as shown in the figure below.
Users don't need to be logged in to use this feature but they can only compare public graphs in this case.

gs-screenshot-compare-graph-tab

Auto Generated Link

Users of Graphspace can also use the auto-generated links to directly run the Graph Diff feature. An example link could be - http://graphspace.org/compare?graph_1=1&graph_2=2&operation=intersection

Graph Intersection

This feature reveals elements (Nodes and Edges) which are common in both Graph.
If there are two graphs with names A, and B - then intersection of A & B is represented as shown in the figure below.

gs-screenshot-compare-graph-intersection

Graph Difference

This feature reveals elements (Nodes and Edges) which are present in one of the Graphs but not the other.
If there are two graphs with names A, and B - then intersection of A & B is represented as shown in the figure below. Difference will only consist of elements unique to Graph A.

gs-screenshot-compare-graph-difference

Compare Graph Page

Compare graph page in Graphspace consists of 2 sections-

gs-screenshot-compare-graph-page

Parameter Selection

In this section, User will select the graphs to compare and the operation (intersection or difference) they want to perform.

gs-screenshot-compare-graph-parameter-selection

Graph selection is supported by way of a dropdown menu. This menu may contain at least one or all of the following graph groups - My Graphs, Shared Graphs, and Public Graphs.

gs-screenshot-compare-graph-graph-dropdown-menu

Add More Graphs

Users can add more graphs to compare by clicking on the Add Graphs button.
A modal popup allows users to select multiple graph for comparison operation.

gs-screenshot-compare-add-more

Searching graphs is possible from the dropdown menu. This feature will helpful when there are many graphs available tComparing Graphso a particular user.

gs-screenshot-compare-graph-graph-dropdown-menu-search

Operation can be selected in similar way using the dropdown menu.

gs-screenshot-compare-graph-graph-operation-menu

By default a coloring scheme is selected for the User, however the user may modify the coloring scheme to suit their needs.
Color scheme can also be changed dynamically anytime after the compare operation has been performed.

gs-screenshot-compare-graph-graph-color-selection

Graph Visualization

This section displays the result of Graph Compare operation.
Information is displayed through 3 distinct tabs -

Visualization Tab

It renders the selected graphs and the observed elements (depending on the operation performed it could common elements or the difference) on a Cytoscape.js canvas.
The coloring scheme selected by the User is used to highlight the different graphs.

User can change this coloring scheme at any time using the 3 color pickers from Selection Area.

gs-screenshot-compare-graph-visualization

Nodes

This tab displays the nodes found after executing the comparison operation in a tabular form similar to the Nodes table in Graphs page.

gs-screenshot-compare-nodes-table

Edges

Displays the edges found after executing the comparison operation in a tabular form similar to the Eddges table in Graphs page.

gs-screenshot-compare-edges-table

Benchmarks for 5-Graph Comparison:

Average case:
0.0405609607697 seconds

Worst Case (71 Nodes - 128 Edges):
0.0503243256577 seconds

Open Questions and Pre-Merge TODOs

  • Use github checklists. When solved, check the box and explain the answer.

Implement graph intersection and graph difference function for two
graphs. Additionally, expose API Endpoints to serve requests from
GraphSpace.

Intersection and Difference are basic functionalities for graph
comparison. In this patch, only 2 graphs are being considered for
comparison.

Two new API endpoints - 1 for graphs compare page and another to
accept GET requests from GraphSpace UI. Do resource hungry computation
in PostGREs DB using SQLAlchemy ORM as much as possible. This helps in
improving performance as computation over large datasets is not
particularly efficient in Python when compared to RDMS. Serialise data
from PostGREs and send as JSON to GraphSpace.
@jahandaniyal jahandaniyal requested a review from adbharadwaj July 31, 2019 11:57
@jahandaniyal jahandaniyal changed the title WIP - Graph comparison for N-Graphs GraphSpace - Diff for Graphs Aug 25, 2019
@jddanna jddanna changed the base branch from develop to master April 12, 2021 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants