aalhour / C-Sharp-Algorithms

:books: :chart_with_upwards_trend: Plug-and-play class-library project of standard Data Structures and Algorithms in C#
MIT License
5.96k stars 1.4k forks source link

Basic optimizations for UndirectedSparseGraph #130

Open melon3r opened 4 years ago

melon3r commented 4 years ago

Description

Optimized item removal from UndirectedSparseGraph by only trying to remove the given item from its neighbors' adjacency lists, instead of all vertices'.

Optimized the Contains function of the DLinkedList structure by avoiding exceptions entirely, as they are costly and not really meaningful in this case (not finding an item in a list is normal, it's not an exception).

Checklist

aalhour commented 4 years ago

Hi @melon3r, pull requests should follow from existing issues, can you please create one first describing what kind of problem you're solving?

melon3r commented 4 years ago

Hi @aalhour, I just created #146