Commit Graph

3406 Commits

Author SHA1 Message Date
K. Noel Belcourt
3d5d6b70f1 Fix a tautological compare warning with clang on mbp. 2016-10-31 15:44:42 -06:00
K. Noel Belcourt
2f18f795a2 Add dependency on missing deprecated header <boost/detail/iterator.hpp>
This so all examples build correctly.  Will need to migrate the rest
of the code to use <boost/iterator/...>  instead.
2016-10-31 15:41:30 -06:00
K. Noel Belcourt
10a5b5182f Remove unwanted side effect from add_edge call. 2016-10-31 15:36:34 -06:00
K. Noel Belcourt
a915aa0ade Silence uninitialized variable warning. 2016-10-31 15:31:52 -06:00
K. Noel Belcourt
090527e0fd Fix unused variable warning. 2016-10-31 15:29:28 -06:00
K. Noel Belcourt
d396eb771e Fix duplicate quick_tour build target. 2016-10-31 14:18:05 -06:00
E Kawashima
b48a9cd5a4 Enable printing functions to use arbitary std::ostream and avoid flush (#71)
* print_in_edges
* print_graph_dispatch
* print_graph
* print_edges
* print_edges2
* print_vertices
2016-10-31 14:10:45 -06:00
E Kawashima
8b5d16c7b0 doc/subgraph.html: fix typo (#76) 2016-10-31 14:06:12 -06:00
akumta
f5bc5e8504 update for ticket #12526 (#77)
Thanks for the patch.
2016-10-31 14:05:52 -06:00
Matt Barr
387bcb3d72 Add degree to reverse_graph (#78)
degree is required for BidirectionalGraphConcept.
Also adds the concept check to the reverse_graph unit test.
2016-10-31 14:03:54 -06:00
Maël Valais
f3b89e9f19 Add Travis-ci as the continuous integration service for Boost.Graph (#63)
* Add travis-ci as CI for boostorg/graph repo.

I thought it would be a great idea to have the test running from a
"neutral entity" instead of having to checkout the pull request and
cd libs/graph/test && ../../../b2

I saw that many other boostorg submodules had their own CI system:
- compute relies on travis-ci
- geometry uses circleci

The major difference between circleci and travis-ci is the multi-threading supported by circleci. Both are free for open-source project (as of 2016/04/26). I chose travis-ci because I know how to configure it.

As for geometry, we could also use coveralls.io to display the test covering reports and improve the quality/coverage of tests on boostorg/graph.

IMPORTANT: a member of boostorg will have to add the repo boostorg/graph into travis-ci for it to work.

* csr_graph_test won't pass unless -std=c++11 is enabled

* Fixed gcc too old (4.6.3) using instead gcc-4.8 for -std=c++11
2016-10-31 13:22:40 -06:00
Murray Cumming
8dd8cd945e Add a .clang-format file. (#68)
So we can at least make the examples use a more consistent code style.

Run clang-format like so:
$ clang-format -i *.cpp
and use git diff to see what has changed.

This will strip trailing whitespace too. You can ignore that by
using git diff -w
2016-10-31 13:21:10 -06:00
Murray Cumming
8f15303620 example: Build all the examples (#64)
* examples: Sort the examples in the Jamfile.

This makes it easier to see which example files are even
mentioned in the build.

* examples: Build all examples.

To at least test that they build with the current API.

The newly-mentioned files here seem to be mostly (maybe all) the
BGL book examples that were added in 2001:
5215e9b4f2
I would prefer to put these all in an examples/bgl_book subdirectory.

* Examples build: Comment out examples that cannot be expected to build.

For instance, because they depend on SBG or Stanford Graph.

* Examples: Add missing <iostream> includes.

* Examples: Comment out unused typedefs and variables.

* Examples: king_ordering: Adapt to newer API.

Specify the extra parameter for king_ordering().
The API was changed in 2005:
4bc19a1621
The test code was already correct:
https://github.com/imvu/boost/blob/master/libs/graph/test/king_ordering.cpp

* Examples: Some graphviz examples: Link to the library.

read_graphviz() is not header only.

* csr-example: Pass edge_are_sorted to constructor.

To use the new (well, in 2009) API:
809904f268

* iteration_macros: Use BGL_FORALL_ADJ.

Not BGL_FORALL_ADJACENT(), which doesn't exist, because this was
changed in 2001:
a0061ba07e

* examples: kevin-bacon2: Fix the build.

Include boost/serialization/string.hpp to fix this error:
kevin-bacon2.cpp:68:9:   required from here
../../../boost/serialization/access.hpp:116:9: error: ‘class std::__cxx11::basic_string<char>’ has no member named ‘serialize’

and link to the boost serialization library.

* examples: loop_dfs: Add a missing typename keyword.

* examples: accum-compile-times: Remove unused variables.

* Examples: Remove unused typedefs.

* examples: avoid warning about parentheses aronud &&.

* example: read_graphviz: Actually use status.

* Example: adj_list_ra_edgelist: Fix the build.

The [] syntax must have worked once but doesn't anymore.
This fixes the build but it is even more clearl now a stupid way to use
the edge iterator.

* Examples: Remove unused typedefs.

* Examples: Remove an unused variable.

* Example: iohb: A const correction.

Otherwise newer compilers complain about converting string literals
to char* when callig this function.

* Exmaples: iohb: Avoid security warning with fprintf().

* Examples: Actually use a variable.

* Examples: Comment out all Graphviz examples.

These use the now-non-existant GraphizGraph and GraphvizDigraph
types. Presumably these could be updated but it's not obvious how
to do that:
https://svn.boost.org/trac/boost/ticket/4762
2016-10-31 13:20:27 -06:00
K. Noel Belcourt
7cb9113a61 Disable csr_graph_test until can work through lack of c++11 support. 2016-10-31 11:02:17 -06:00
Murray Cumming
0d3be12b42 random.hpp: weighted_random_out_edge(): Add missing return. (#74)
This should avoid a compiler warning. For instance:
http://beta.boost.org/development/tests/develop/output/GLIS-homo-impi-graph-intel-linux-warnings.html#cycle_ratio_tests

Looks good, thanks.
2016-08-09 19:51:39 -06:00
K. Noel Belcourt
54589358a4 Disable csr_graph_test until can work through lack of c++11 support. 2016-07-24 13:41:26 -06:00
Murray Cumming
56d3e72155 bc_clustering: Remove an unused typedef. (#66)
Thanks.
2016-07-16 17:19:23 -06:00
Murray Cumming
7e54f9997d Make files not executable. (#69)
See https://github.com/boostorg/admin/issues/47
2016-07-16 17:19:11 -06:00
Nicholas Matteo
2796c0a147 Fix typos (#70)
Thanks!
2016-07-16 17:18:57 -06:00
Murray Cumming
2f8b0897aa bc_clustering: Remove an unused typedef. (#66)
Thanks.
2016-07-16 17:08:04 -06:00
Murray Cumming
a9c0fa9495 Make files not executable. (#69)
See https://github.com/boostorg/admin/issues/47
2016-07-16 17:05:54 -06:00
Nicholas Matteo
2f257fa083 Fix typos (#70)
Thanks!
2016-07-16 17:04:30 -06:00
K. Noel Belcourt
b50fe850a2 Apologies to whomever committed this patch, I was unable to locate
the original commit to cherry-pick so have picked this source up
from develop and committed to master.
2016-07-16 16:43:20 -06:00
K. Noel Belcourt
529934f827 Apologies to whomever contributed this patch, I lost the original
commit.  Pick this from develop as work towards moving master
towards develop for the next release.
2016-07-16 16:41:07 -06:00
K. Noel Belcourt
caa8fd4568 Minor wordsmiting and formatting picked from develop. 2016-07-16 16:39:16 -06:00
K. Noel Belcourt
c7a6fdc418 Fixes unused variable warnings, picked from develop. 2016-07-16 16:35:16 -06:00
Murray Cumming
0ce03767a8 Add a README.md file.
So people can see what the project even is when they reach the GitHub repository.
Also, even the documentation doesn't have an actual short description of what
BGL is.
And, without a direct link, it is very hard to find the list of open issues
on Boost's trac system.

With many improvements from Maël Valais:
https://github.com/murraycu/graph/pull/1
2016-07-16 16:19:11 -06:00
Murray Cumming
8321c79d20 tree_traits: Add include for boost::tie().
This lets examples/graph_as_tree compile.
2016-07-16 16:18:52 -06:00
Maël Valais
589584b4e4 Fix #11374 and #12038: issues with find_flow_cost(), bundled properties and named parameters (#61)
* trac 11374: find_flow_cost() not working with bundled properties.

When using bundled for Weight and Cost properties, find_flow_cost() coudln't work because the properties had been "hard coded" instead of using generic types.

Fixes https://svn.boost.org/trac/boost/ticket/11374

* trac 12038: max-flow algorithms not working with named parameters.

The named parameter "Capacity" was not working. I just had to reverse the order of get_param_type parameters.

Here are the max-flow algorithms that are curretly not working with the named parameter "Capacity":
- edmonds_karp_max_flow,
- push_relabel_max_flow,
- boykov_kolmogorov_max_flow.

Fixes https://svn.boost.org/trac/boost/ticket/12038

* trac 11374: find_flow_cost() not working with named parameters and bundled properties at the same time.

When using bundled properties as well as named parameters, there was an error.

What happened is that the "named parameters" version of find_flow_cost() was not using a generic return value, hence the error.

Also, the return value_type was using edge_capacity_value instead of edge_weight_value (which is the type of a flow cost).

I fixed it using the trick used for edmonds_karp_max_flow(): add `edge_weight_value` to named_function_params.hpp.

* Unit test find_flow_cost() with bundled properties & named params.

-> unit tests for trac 11374

I used the existing min_cost_max_flow_utils.hpp, but I had to make the graph of getSampleGraph() more generic.

In the first place, I wanted to make a compile-only test but I also made
the test runnable so we check that
- find_flow_cost works() correctly with bundled properties
- successive_shortest_path_nonnegative_weights() also works with bundled properties

To run this test, this is a bit painful...
I had to run the entire graph-related tests.
- I commented the other tests except for graph in ./status/Jamfile.v2
- in this same dir, I ran `../b2`

One issue though: csr_graph_test seems to be broken on my boost copy, I may have an issue with updating the submodules or something...

* Unit test edmond_karp_max_flow with named params & bundled properties.

-> unit tests for trac 12038

As the previous commit, I rely on min_cost_max_flow_utils.hpp.

And I also made a runnable test instead of a simple "compile-time" test.

* Indented with 2 spaces instead of tabs

Thanks for the patch!
2016-07-16 16:18:35 -06:00
Justin Viiret
f0faaabca1 Make lengauer_tarjan_dominator_tree use indexMap (#49)
Pass the indexMap parameter through to the dominator_visitor and use it
instead of get(vertex_index, g). This allows this algorithm to be used
for graphs without a vertex_index property.

Addresses bug #11742.
2016-07-16 16:18:22 -06:00
K. Noel Belcourt
4b07d0b469 Eliminate unused variable, regularize formatting. 2016-07-16 16:17:54 -06:00
K. Noel Belcourt
cdc7f4f75b Remove unused member variable. 2016-07-16 16:17:44 -06:00
K. Noel Belcourt
9249b640e4 Fix a stack variable bound to member reference, a concept
checking variable that was unused triggering a warning,
and a documentation typo.
2016-07-16 16:17:33 -06:00
coderakki
c0756b5ebf Update kamada_kawai_spring_layout.hpp (#53) 2016-07-16 16:17:21 -06:00
Alexander Lauser
a14f8df86c Fixed bug 10231 partly: If finish_edge was called, then now correctly. (#16)
This appears to be fixed, we may have to patch this to ensure there's no backward compatibility issues with older compilers.  Thanks for the bug report and patch.

The bug that it never gets called with the current construction remains.
2016-07-16 16:17:09 -06:00
K. Noel Belcourt
7f94230dca Revert "removed an unused function (#39)"
This reverts commit 655ce30eb3.
2016-07-16 16:16:59 -06:00
Mads Jensen
ecf83843e7 removed an unused function (#39)
The C++ standard deprecates use of <stdio.h>, <stdlib.h> etc., and suggests using <cstdio>, <cstdlib> etc.

Some trailing whitespace removed in affected files because of a setting in my editor

dead code surrounded by #if 0 ... #endif removed
2016-07-16 16:16:42 -06:00
K. Noel Belcourt
13cea9c32b Fix unused variable warning. 2016-07-16 16:16:33 -06:00
K. Noel Belcourt
50cb642e94 Quiet an unused variable warning. 2016-07-16 16:16:23 -06:00
sehe
c112afbbad Fix labeled_graph constructors (#58)
* Fix labeled_graph constructors

* Wraparound bug leads to out-of-bounds addressing. 

    Seems obvious that `> 0` was meant (seeing the comments). 
    Also, if `vertices_size_type` is unsigned - which it usually (always?) is - the loop condition was never false.

 * Finally, one constructor didn't properly initialize the graph property

* Copy vertex property on add_vertex

Tested with clang on El Capitan, thanks!
2016-07-16 16:16:09 -06:00
felix
b1a4f32b1f use graph_traits to access *_category types of a Graph (#54)
Tested with El Capitan and clang-darwin, thanks!
2016-07-16 16:15:54 -06:00
Arne B
f9e930f006 Fixes bug 10449 (#57)
Without this patch it is not possible to call the copy constructor of directed_graph
2016-07-16 16:15:36 -06:00
E Kawashima
a4e6f4dd78 fix typo in document of subgraph (#62)
Thanks!
2016-07-16 16:15:20 -06:00
Jakob Lykke Andersen
753c88c484 Add missing check for 'degree' in BidirectionalGraphConcept. Fix the concept checking class in the documentation for BidirectionalGraphConcept. Implementation of missing 'degree' function for filtered_graph. (#29)
Thanks for the patch.
2016-07-16 16:15:09 -06:00
Jared Grubb
fa7ef591c2 Fix Ticket #11133: Graph: using 'nil' as a local variable (#34)
Looks good, thanks.
2016-07-16 16:14:55 -06:00
Louis Dionne
eec98072db [Doc] Fix broken link to article for hawick_circuits, and remove useless .md file (#50)
Also update copyright and add license information.

Thanks for the patch.
2016-07-16 16:14:38 -06:00
Jakob Lykke Andersen
48b63adf44 Doc: remove IncidenceGraph requirement from AdjacencyGraph. (#28)
Thanks for the fix, it's good to have to documentation reflect the actual code.
2016-07-16 16:14:16 -06:00
Daniel J. H
b0214ec131 Fix some minor documentation annoyances (#51)
* Fix documentation about type alias edge_size_type -> edges_size_type

This replaces occurences of `edge_size_type` (sg.) in the documentation
with the actual `edges_size_type` (pl.) as it is named in the
implementation.

There is a graph implementation (Stanford graph) that has a type alias
of `edge_size_type` (sg.) --- I did not change that implementation, as
it would break backwards compatibility, and therefore I also did not
change its documentation.

* Fix documentation on push_relabel algorithm, defined in header: preflow_push -> push_relabel
2016-07-16 16:14:01 -06:00
Vladimir Prus
ba0cf281c9 Add missing include of <list>.
Thanks to Amit Prakash Ambasta for the report.
2016-07-16 16:13:34 -06:00
Ola Nilsson
b5171962bf Fix doc spelling 2016-07-16 16:12:09 -06:00