-
Notifications
You must be signed in to change notification settings - Fork 0
/
TODO.txt
21 lines (11 loc) · 2.42 KB
/
TODO.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
- Search by name over nodes should be improved by sorting the array of nodes or implementing good hash table!
- Since graph stores labels it will be better to make nodes store pointers to labels instead of labels themselves node::node.set_label() should be changed to something that checks what are the other labels in the graph, and storing pointers instead of labels themselves will make it natural. Also it will be more efficient to implement node::set_label(unsigned int label_id). But this optimization is questionable since nodes outside the graph will have no labels. In this case node should be a protected class in class graph and node should store the pointer to a graph to which it belongs. This can be implememted differently. Node can erase label_name every time it is added to a grph, since label has id. Alternatively if we get rid of ids we can store labels as char* and everytime we add node to a graph delete[] this char and redirect the pointer to the corresponding label - this is better since node does not have to know anything about the graph in this case and char* replaces the id.
- Do the same thing with links. Create class graph::link_type : public graph::label and store link types in the graph while only storing pionters to the link types in the links which are in the graph.
- Implement your own lists (or, better, deque or que) and instead of saving array of itterators to links in each node, save array of pointers.
- Possibly get rid of node and label ids
- Change link type type from std::string to char*, since empty std::string weighs 56 bytes.
- "remove_nodes_with_degree" and "remove_nodes_with_label" functions should be optimised
- Instead of storing the array of labels in the graph it will be good to implement nested class "labeling" which should encapsulate the array of labels and allow increments, which are needed for node classification functions. Maybe this is not needed since now we only store the array of labels which occur in the graph not the full labels assignment.
- Links may store iterators in the list. That way one can efficiently remove links based on pointers to them.
- Functions run_Glauber_dynamics_with_fields and run_Glauber_dynamics_no_fields should be unified to one function with additional argument of fields set to 0 by default. There is no need in introducing a field node as it slows down the computation.
- Label should more logically be a nested class of class node rather than class graph