maminrayej / prepona

A graph crate with simplicity in mind

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Apply Dijkstra's algorithm on subgraphs

redbug312 opened this issue · comments

I have another question of the algorithms.

Some algorithms like Dijkstra's cannot be applied on subgraphs, because these algorithms require Graph trait implemented.
However, the Graph trait is used only to construct the returned frozen subgraphs, should prepona separate that and provide another trait to construct results?

I've experimented and found this works, but I'd want to ask for opinions. As this seems relates to the layered architecture.

pub trait View<W, E: Edge<W>, Dir: EdgeDir> {
    type Base: Graph<W, E, Dir> + Edges<W, E> + Vertices + Neighbors;
    fn base(&self) -> &Self::Base;
}

Hi and sorry for this long delay.
I've just defended my thesis and, I'm finally free to work on things that I like, including Prepona.

You're right. The relationship between Graph and Subgraph is not modeled well. The whole View system in Prepona is not satisfactory, at least not to me.
There are other core problems as well. Modeling meta graphs, hypergraphs, etc is impossible in Prepona because of its elementary vertex and edge modeling.
Another problem that comes to my mind is graph data augmentation which is difficult to achieve using Prepona.
These shortcomings are partly due to my limited knowledge of graph theory which I'm trying to mitigate now by researching.

That's why I'm starting from scratch for prepona 0.2 and try to put time and effort into modeling before implementing anything.