Kemsekov / GraphSharp

GraphSharp is a tool to study and use knowledge of graph theory in C#!
MIT License
37 stars 5 forks source link

A whole bunch of redesigning needed #71

Closed Kemsekov closed 6 months ago

Kemsekov commented 1 year ago

1) Divide all functional of algorithms into inheritance chain.

Aka add algorithm base class, interfaces, so there could be different spanning tree implementations that works on same interface.

Do not contain all implementations in same partial class, keep the class and methods, but move implementations aside into dedicated classes.

Your code base is just unmovable, when needed to use different implementations, all algorithms is basically hardcoded.

2) Basic functional for edge source and node source should not be implemented from static extensions.

Following same logic, when you will need to override some graph logic, you will not be able to.

3) Algorithm and it's result must reside in different classes. Like GreedyColoring must have method Color() that returns ColoringResult instance

3) in theory, you should fix your tests mess, but it is not so important now.

Kemsekov commented 6 months ago

Actually, I have been thinking over it and doing some stuff, and the the end I just abstracted away all properties of node and edge into dictionary under each node and edge, which is more convenient and allows to store any information needed, and I am pretty much happy rn how it works