graph-tool:6b959e206bc7afcd126a11a943083713d5029e25 commitshttps://git.skewed.de/count0/graph-tool/-/commits/6b959e206bc7afcd126a11a943083713d5029e252012-05-02T09:27:43+02:00https://git.skewed.de/count0/graph-tool/-/commit/6b959e206bc7afcd126a11a943083713d5029e25Update copyright information2012-05-02T09:27:43+02:00Tiago de Paula Peixototiago@skewed.dehttps://git.skewed.de/count0/graph-tool/-/commit/67a10cd3fb323c8b9fcd2611dcc18e97ed04600aImplement edge_difference()2012-04-11T11:02:50+02:00Tiago de Paula Peixototiago@skewed.dehttps://git.skewed.de/count0/graph-tool/-/commit/46454b3d28477147707187297dac95eff3ea9481Implement reindexing of property maps after vertex purge2012-04-11T10:57:45+02:00Tiago de Paula Peixototiago@skewed.de
After the removal of filtered vertices via Graph.purge_vertices(), the
values of known property maps are now kept consistent with the
unmodified graph.https://git.skewed.de/count0/graph-tool/-/commit/0595e4f34e0eb854cf9efb2f38e6a557d798c2b8Implement infect_vertex_property()2012-04-11T10:53:32+02:00Tiago de Paula Peixototiago@skewed.dehttps://git.skewed.de/count0/graph-tool/-/commit/df3471a11b86025d8b88bf221b4875bfa2c88050Simple workaround for compilation under MacOS2011-05-27T16:42:54+02:00Tiago de Paula Peixototiago@skewed.de
This works around a compilation bug in Apple GCC 4.2 + Macports.https://git.skewed.de/count0/graph-tool/-/commit/011d7b65b197dcfdef5474f8bb26e67b6d8995bbUpdate copyright year2011-02-10T14:23:12+01:00Tiago de Paula Peixototiago@skewed.dehttps://git.skewed.de/count0/graph-tool/-/commit/72bd25b3c02dd3b87c6cef06e589df032804d976Implement GraphView class2011-02-02T15:24:18+01:00Tiago de Paula Peixototiago@skewed.de
This implements a GraphView class which allows for convenient,
independent filtering graphs.https://git.skewed.de/count0/graph-tool/-/commit/b3dd46c303ae31cf0b0f6ea8953633df9f647c37Modify GraphWrap semantics2010-12-04T21:12:51+01:00Tiago de Paula Peixototiago@skewed.de
Now, whenever GraphWrap is being used, the property maps are always
in "checked" mode.https://git.skewed.de/count0/graph-tool/-/commit/ddd2c98f0dfc6785e474f1237b23e73763e4749fSmall clarification in include order2010-11-24T20:20:05+01:00Tiago de Paula Peixototiago@skewed.dehttps://git.skewed.de/count0/graph-tool/-/commit/6758e857b6b6e36edcbe8927d2e61d027e5149b0Change domain to skewed.de2010-11-13T21:20:03+01:00Tiago de Paula Peixototiago@skewed.dehttps://git.skewed.de/count0/graph-tool/-/commit/60acdcfacca14e9c09f960d5af4d16b38914c4e6Include Graph.reindex_edges() and Graph.max_edge_index2010-07-30T13:00:59+02:00Tiago de Paula Peixototiago@skewed.de
These functions/properties provide more information and control about
edge indexing, which might be useful.https://git.skewed.de/count0/graph-tool/-/commit/2baba488250af2c470829e18dcc89ffe896c04bcFix bug in PropertyMap.get_array() for edge properties2010-07-28T17:15:44+02:00Tiago de Paula Peixototiago@skewed.de
The reserved size for the array was set to g.num_edges(), but it should
be set to the maximum edge index + 1, since some edges might have been
deleted.https://git.skewed.de/count0/graph-tool/-/commit/a5d75e84c50941f63549a286fb49e678e90ab3eaAdd numpy.array access to vector types of property maps2010-05-21T09:52:11+02:00Tiago de Paula Peixototiago@skewed.de
Now vector types of property maps can be accessed as arrays with the
get_array() and 'a' property, just like scalar property maps.https://git.skewed.de/count0/graph-tool/-/commit/b9bbc35016cbbdfc3d2bd1c79aee6ef7d6d50e31Update encoding and copyright information in source files2010-03-07T12:14:19+01:00Tiago de Paula Peixototiago@skewed.dehttps://git.skewed.de/count0/graph-tool/-/commit/c6c01d62b21f0046388eb73ecb7f4491954162b3Edge and vertex descriptors now carry a weakref to their Graphs2009-09-18T17:36:33+02:00Tiago de Paula Peixototiago@skewed.de
This fixes an obvious problem, where the graph gets deleted, and the
descriptors are still lying around. Usage of orphaned descriptors will
now just raise a ValueError.
The __repr__ function of Edge, Vertex, and PropertyMap now give
something more informative about each object.https://git.skewed.de/count0/graph-tool/-/commit/0db15a14061371806d615c9cf7f587e9579eca25Implement group_vector_property() and ungroup_vector_property()2009-09-03T09:20:46+02:00Tiago de Paula Peixototiago@skewed.de
These functions group several scalar properties into one vector
properties, and ungroup a vector property into several scalar
properties.https://git.skewed.de/count0/graph-tool/-/commit/7fb5d71da3df0b11c00f0343607c5b9ff3d15900Dump lambda::bind in favor of boost::bind2009-08-21T17:43:19+02:00Tiago de Paula Peixototiago@skewed.de
This is a large commit which replaces lambda::bind with boost::bind in
most parts of the code. This improves compilation time, and slightly
decreases compilation memory usage in some cases.https://git.skewed.de/count0/graph-tool/-/commit/f257d42612a9d6e4815c3717bfd0b6b7e273c5d4Reorganize exceptions thrown2009-08-13T19:55:46+02:00Tiago de Paula Peixototiago@skewed.de
No longer only thrown GraphError upon any error, but instead throw
specific exceptions which are more meaninful and are mapped to standard
python exceptions, such as IOError, ValueError and RuntimeError.https://git.skewed.de/count0/graph-tool/-/commit/7e6968aa32bca549c91958600899d5c0afa95dfcImplement show_config()2009-08-02T22:01:49+02:00Tiago de Paula Peixototiago@skewed.de
This prints useful library information.https://git.skewed.de/count0/graph-tool/-/commit/684efca78dc92b2405d60dbeb86efa554fc55b40Implement optional wrapping of graphs to deal with edge index housekeeping2009-03-10T14:51:14+01:00Tiago de Paula Peixototiago@skewed.de
Thins changes the graph filtering code slightly to wrap graph types with
GraphWrap, which automatically updates the edge index list when edges
are removed and added to the graph.
This also changes how graphs are passed to algorithms, which is now by
reference instead of pointer. (hence this touches lots of code, but
changes are trivial)https://git.skewed.de/count0/graph-tool/-/commit/0c87c492f7fbe12934669c456b8e21f3f64dbb5dImprove run_action module2009-02-06T01:18:33+01:00Tiago de Paula Peixototiago@skewed.de
Now inline() automatically converts known variables (such as property
maps) and defaults to boost::python objects, instead of scxx objects.
The code now is only generated for the current filtered, reversed and/or
directed status of the graph, reducing compile time and binary size.
Edge modification (remove and add) is now protected by a GraphWrap
class, which takes care of the edge index housekeeping, which does not
need to be done by hand anymore.
The function is also no longer bound to one graph, and can take an
arbitrary number of variables of known or unknown types, including
graphs.https://git.skewed.de/count0/graph-tool/-/commit/d6422b73bc33bfba976dff9db245d5069ec6e946Fix symbol visibility2009-02-06T01:18:33+01:00Tiago de Paula Peixototiago@skewed.de
Now all symbols are exported by default, except those strictly marked
as hidden.https://git.skewed.de/count0/graph-tool/-/commit/8ae75c9fac3802c464cff63e14380ec1f83512beAdd direct support for degree propery map creation2009-02-06T01:18:33+01:00Tiago de Paula Peixototiago@skewed.de
i.e. g.degree_property_map("in") will create and return a vertex property map
which corresponds to the in-degrees of the vertices. This is useful for
temporarily modifying or getting an array of degrees.https://git.skewed.de/count0/graph-tool/-/commit/e84aaf3ce4af0ebd6acc152dfd0c62f0b2bb329bAdd support for array access to property maps2009-02-06T01:18:32+01:00Tiago de Paula Peixototiago@skewed.de
A property map object has now a get_array() member which returns an internally
owned array pointing to the property values.https://git.skewed.de/count0/graph-tool/-/commit/7cdf965828e9bcdd7f28d24142f8412e7ed4b281Expose internal graph and index maps in GraphInterface2008-12-02T01:17:25+01:00Tiago de Paula Peixototiago@skewed.de
This makes operations on graphs more flexible in some circumstances.https://git.skewed.de/count0/graph-tool/-/commit/872d1c5d519abeae95570d254f183ede684233ccFix bug when copying graph with filtering disabled2008-07-21T20:34:52+02:00Tiago de Paula Peixototiago@skewed.de
Also, get rid of g.underlying_graph(), and rely on "private" variable
g._Graph__graph instead.https://git.skewed.de/count0/graph-tool/-/commit/242bfff7d6bc8543621c8e3ada532e1d1f7a0a42Propagate external property map usage to all algorithms2008-07-15T15:26:22+02:00Tiago de Paula Peixototiago@skewed.dehttps://git.skewed.de/count0/graph-tool/-/commit/e984bf8e293ae4386fafaa06effbfb56c51f1739Externalize property maps by default2008-06-17T22:16:40+02:00Tiago de Paula Peixototiago@skewed.de
This commit removes the internal property maps from the GraphInterface
class, and makes all property maps external by default. The internal
property maps were moved to the python layer.https://git.skewed.de/count0/graph-tool/-/commit/7d8195d463a4a62c031cca58e24a0dbb9cddd4f4Improve compatibility between weave's cxx and boost::python2008-05-06T16:19:36+02:00Tiago de Paula Peixototiago@skewed.de
Other objects are now automatically converted (tuple, lists, dicts,
str).https://git.skewed.de/count0/graph-tool/-/commit/713c9854a1d02ab828833b2eb2e8ad795af8a2c3Fix assortativity for undirected graphs (ticket #52)2008-05-01T18:28:40+02:00Tiago de Paula Peixototiago@skewed.dehttps://git.skewed.de/count0/graph-tool/-/commit/cfb623518c99b89a2e2646018147efb08df60380Fix boost and boost::python ambiguity and numpy problems in run_action2008-04-15T19:41:49+02:00Tiago de Paula Peixototiago@skewed.dehttps://git.skewed.de/count0/graph-tool/-/commit/ee25eabe1dff409b1a6112bdced449096733893aFix run_action2008-04-14T14:58:45+02:00Tiago de Paula Peixototiago@skewed.de
A couple of bugs fixed. Local frame dict is read-only in python, so the
updated arguments are returned in a dict instead.https://git.skewed.de/count0/graph-tool/-/commit/360a3395d6f7cdd4d2fc39f6f8a9e75b764d3766Correlations algorithms refactoring2008-04-10T14:35:35+02:00Tiago de Paula Peixototiago@skewed.de
The whole histogram code has been redone, and the code has been
simplified. The three-point vertex-edge-vertex correlation has been
scrapped, since it's not frequently used, and would make compilation
even more expensive.
This also adds some missing files to the generation routine.https://git.skewed.de/count0/graph-tool/-/commit/99bf21c89b278d40845ab8128bb1ea2cd73af980Port graph I/O to new filtering engine, enable graph pickling, and fix severa...2008-03-27T14:11:11+01:00Tiago de Paula Peixototiago@skewed.de
Now graphml files properly contain all the supported value types, which
are all perfectly preserved when read (floating point data is now saved
in hexadecimal format). Several other improvements were made, such as
the ability to read and write to python file-like objects.
It is also now possible to have arbitrary python object properties, and
store them persistently (which is done internally with the pickling
interface).
vector<bool> was totally abolished, since its implementation is quite
broken. See: <a href="http://www.gotw.ca/publications/N1211.pdf" rel="nofollow noreferrer noopener" target="_blank">http://www.gotw.ca/publications/N1211.pdf</a> and
<a href="http://www.gotw.ca/publications/N1185.pdf" rel="nofollow noreferrer noopener" target="_blank">http://www.gotw.ca/publications/N1185.pdf</a> Now a uint8_t (aka. char) is
used in graph properties instead of a bool.
Graph types can now be fully pickled (this may not be feasible
memory-wise if the graph is too large, since the whole XML
representation is dumped to a string before it is saved on disc).https://git.skewed.de/count0/graph-tool/-/commit/3cfff0cb2954d5c7d7603896b627713e1bea7665Split libgraph_tool into sub-modules and add test cases2008-02-17T11:57:13-03:00Tiago de Paula Peixototiago@skewed.de
This commit splits libraph_tool into different libraries:
- libgraph_tool_core
- libgraph_tool_clustering (*)
- libgraph_tool_community (*)
- libgraph_tool_correlations (*)
- libgraph_tool_distance (*)
- libgraph_tool_generation (*)
- libgraph_tool_layout (*)
- libgraph_tool_misc (*)
- libgraph_tool_stats (*)
It also adds the python sub-module 'test', which provides extensive unit
testing of the core functionality. The core library is fully functional
and all test pass successfully.
(*) -> module needs to be ported to new refactoring, and does not yet buildhttps://git.skewed.de/count0/graph-tool/-/commit/0b66e272dc498358778aa6d81c0dd99adbabb136Refactor metaprogramming engine2008-02-10T02:42:51-02:00Tiago de Paula Peixototiago@skewed.de
This is a huge commit which completely refactors the metaprogramming
engine which generates and selects (at run time) the graph view type and
the desired algorithm implementation (template instantiation) that runs
on it.
Things are laid out now as following. There exists a main underlying
graph type (GraphInterface::multigraph_t) and several other template
classes that mask it some way or another, in a hierarchic fashion:
multigraph_t -> filtered_graph (edges only, vertices only, both)
| | | |
| | | |
|-------(reversed_graph)--------|-----------|-----------|
| | | |
\------(UndirectedAdaptor)------------------------------/
The filtered_graph filters out edges and/or vertices from the graph
based on some scalar boolean property. The reversed_graph reversed the
direction of the edges and, finally, the UndirectedAdaptor treats the
original directed graphs as undirected, transversing the in- and
out-edges of each vertex indifferently. Thus, the total number of graph
view types is 12. (The option --disable-graph-filtering can be passed to
the configure script, which will disable graph filtering altogether and
bring the total number down to 3, to reduce compile time and memory
usage)
In general, some specific algorithm, implemented as a template function
object, needs to be instantiated for each of those types. Furthermore,
the algorithm may also depend on other types, such as specific
property_maps. Thus, the following scheme is used:
struct my_algorithm // algorithm to be implemented
{
template <class Graph, class PropertyMap>
void operator()(Graph *g, PropertyMap p, double& result) const
{
// ...
}
};
// in order for the above code to be instantiated at compile time
// and selected at run time, the run_action template function object
// is used from a member function of the GraphInterface class:
double GraphInterface::MyAlgorithm(string prop_name)
{
double result;
boost::any vprop = prop(property, _vertex_index, _properties);
run_action<>()(*this, bind<void>(my_algorithm(), _1, _2,
var(result)),
vertex_scalar_properties())(vprop);
return result;
}
The whole code was changed to reflect this scheme, but now things are
more centralized and less ad-hoc code needed to be
written. Unfortunately, due to GCC's high memory usage during template
instantiations, some of the code (namely all the degree correlation
things) had to be split in multiple compilation units... Maybe this will
change in the future if GCC gets optimized.
This commit also touches other parts of code. More specifically, the way
filtering gets done is very different. Now we only filter on boolean
properties, and with the above scheme, the desired implementation runs
with the correct chosen type, and no implicit type conversions should
ever happen, which would have a bad impact on performance.https://git.skewed.de/count0/graph-tool/-/commit/4a7da8a9a04be0b5fa13bfc4f1b14e74b158bbfeDirectory restructuring of graph_tool Python module (now a package)2007-12-21T16:28:14-02:00Tiago de Paula Peixototiago@skewed.de
Everything was moved into the graph_tool directory, which should have,
after installation, the following structure:
graph_tool/ Top-level package
__init__.py Initialize the graph_tool package
libgraph_tool.so libgraph_tool submodule
libgraph_tool.la libtool file for libgraph_tool
include/ C++ include files for dynamically
compiled codehttps://git.skewed.de/count0/graph-tool/-/commit/cb15708b4886861ae2486ddb7f437b02897072efSome reorganization and change check_filter() to run_action()2007-12-13T01:29:01-02:00Tiago de Paula Peixototiago@skewed.dehttps://git.skewed.de/count0/graph-tool/-/commit/1a0e9b5f7bf96ebe65dbe78b08f2b81c5a858892Further improvements of the python interface2007-11-30T00:11:53-02:00Tiago de Paula Peixototiago@skewed.de
Property maps can now be obtained as such:
weight = g.edge_properties['weight']
print weight[v] # v is a Vertex object
weight[v] = 2.0
# and so on...
The list of properties is obtained from g.vertex_properties,
g.edge_properties and g.graph_properties, which can be read as
dictionaries. The last can be set also, as such:
g.graph_properties = {foo:"bar", baz:42}
Functions to add and remove vertices or adges were also added
(add_{vertex|edge}, remove_{vertex|edgge}).
Vertex and Edge types can also now be printed for convenience, as such:
for v in g.vertices():
print v
for e in g.edges():
print e
which results, for example, in:
0
1
2
3
4
5
6
(0,1)
(1,2)
(2,6)
(3,4)
(4,5)
(4,2)
(5,6)
(6,1)
(this also adds the forgotten graph_tool.py file, which was previously
on .gitignore)https://git.skewed.de/count0/graph-tool/-/commit/06358b7c421166f0d00affcb15e5d28835765d87Further improvement of python interface2007-11-26T11:57:11-02:00Tiago de Paula Peixototiago@skewed.de
Vertices and edges can be accessed from the graph class, as such:
import graph_tool
g = graph_tool.Graph()
for v in g.vertices():
for e in v.out_edges():
# do something...
Additionally, the --edit-{vertex|edge|graph}-property was ported to the
new interface, and is working again, as it used to.
The Vertex and Edge class no longer have the 'get_property' and
'set_property' method. They'll be replaced by a new method of accessing
property maps.